Author: duncan
Date: Tue Jul 24 16:22:23 2007
New Revision: 9763

Log:
[ 1759171 ] View Record Program Description and VideoItem actions
Patch from Adam Charrett applied


Modified:
   branches/rel-1/freevo/src/tv/plugins/recordings_manager.py
   branches/rel-1/freevo/src/tv/program_display.py

Modified: branches/rel-1/freevo/src/tv/plugins/recordings_manager.py
==============================================================================
--- branches/rel-1/freevo/src/tv/plugins/recordings_manager.py  (original)
+++ branches/rel-1/freevo/src/tv/plugins/recordings_manager.py  Tue Jul 24 
16:22:23 2007
@@ -60,6 +60,7 @@
 from gui import ConfirmBox, AlertBox, ProgressBox
 from menu import MenuItem, Menu
 from video import VideoItem
+from tv.program_display import ShowProgramDetails
 
 disk_manager = None
 
@@ -129,6 +130,7 @@
             ('TVRM_CONSIDER_UNWATCHED_AFTER', 45, 'Number of days after which 
to consider deleting unwatched shows if space is required'),
             ('TVRM_EPISODE_FROM_PLOT', None, 'Regular expression to extract 
the episode name from the plot'),
             ('TVRM_EPISODE_TIME_FORMAT', '%c', 'When the episode name cannot 
be found use timestamp'),
+            ('TVRM_ADD_VIDEO_ACTIONS', False, 'Append VideoItem actions to the 
end a RecordedProgramItem list of actions'),
         ]
 
 
@@ -384,11 +386,14 @@
         """
         return the default action
         """
-        return [ ( self.play, _('Play') ),
-                 ( self.confirm_delete, _('Delete')),
-                 ( self.mark_to_keep, self.keep and _('Unmark to Keep') or 
_('Mark to Keep')),
-                 ( self.mark_as_watched, self.watched and _('Unmark as 
Watched') or _('Mark as Watched'))]
-
+        actions = [ ( self.play, _('Play') ),
+                         ( self.confirm_delete, _('Delete')),
+                         ( self.mark_to_keep, self.keep and _('Unmark to 
Keep') or _('Mark to Keep')),
+                         ( self.mark_as_watched, self.watched and _('Unmark as 
Watched') or _('Mark as Watched')),
+                         ( self.view_details, _('View Details'))]
+        if config.TVRM_ADD_VIDEO_ACTIONS:
+            actions += self.video_item.actions()[1:] # Remove 'Play' as we've 
already got it.
+        return actions
 
     def play(self, arg=None, menuw=None):
         """
@@ -445,6 +450,8 @@
             copy_and_replace_menu_item(menuw, self)
             menuw.refresh(reload=True)
 
+    def view_details(self, arg=None, menuw=None):
+        ShowProgramDetails(menuw, Details(self))
 
     def set_name_to_episode(self):
         """
@@ -952,3 +959,18 @@
     elif watched:
         order = orders[STATUS_ORDER_WATCHED]
     return order
+
+
+class Details:
+    def __init__(self, episode):
+        self.episode = episode
+        self.time = episode.video_item['year']
+        self.title = episode.name
+        self.sub_title = episode.video_item['tagline']
+        self.desc  = episode.video_item['plot']
+        self.ratings    = {}
+        self.advisories = []
+        self.categories = []
+
+    def getattr(self, attr):
+        return getattr(self, attr)

Modified: branches/rel-1/freevo/src/tv/program_display.py
==============================================================================
--- branches/rel-1/freevo/src/tv/program_display.py     (original)
+++ branches/rel-1/freevo/src/tv/program_display.py     Tue Jul 24 16:22:23 2007
@@ -649,24 +649,24 @@
         else:
             name = prg.title
             sub_title = prg.sub_title
-            time =  prg.getattr('time') 
+            time =  prg.getattr('time')
             if sub_title:
                 description = u'"' + sub_title + u'"\n' + prg.desc
             else:
                 description = prg.desc
-            
+
             if prg.categories:
                 description += u'\n'
-                
+
             for category in prg.categories:
                 description += u'\n' + _('Category : ') + category
-            
+
             if prg.advisories:
                 description += u'\n'
- 
+
             for advisory in prg.advisories:
                 description += u'\n' + _('Advisory : ') + advisory
-            
+
             if prg.ratings:
                 description += u'\n'
 
@@ -688,7 +688,7 @@
     def getattr(self, name):
         if name == 'title':
             return self.name
-        
+
         if self.program:
             return self.program.getattr(name)
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to