Author: duncan
Date: Tue Aug 21 13:53:04 2007
New Revision: 9834

Log:
[ 1778130 ] recordserver not starting because of video item
Patch from Tanja Kotthaus applied


Modified:
   branches/rel-1/freevo/src/video/videoitem.py

Modified: branches/rel-1/freevo/src/video/videoitem.py
==============================================================================
--- branches/rel-1/freevo/src/video/videoitem.py        (original)
+++ branches/rel-1/freevo/src/video/videoitem.py        Tue Aug 21 13:53:04 2007
@@ -41,7 +41,6 @@
 import util
 import rc
 import menu
-import skin
 import configure
 import plugin
 import kaa.metadata as metadata
@@ -91,10 +90,20 @@
         self.elapsed           = 0
 
         self.possible_player   = []
-
         self.player        = None
         self.player_rating = 0
 
+        for p in plugin.getbyname(plugin.VIDEO_PLAYER, True):
+            rating = p.rate(self) * 10
+            if config.VIDEO_PREFERED_PLAYER == p.name:
+                rating += 1
+            if hasattr(self, 'force_player') and p.name == self.force_player:
+                rating += 100
+            self.possible_player.append((rating, p))
+        self.possible_player.sort(lambda l, o: -cmp(l[0], o[0]))
+        self.player_rating, self.player = self.possible_player[0]
+
+
         # find image for tv show and build new title
         if config.VIDEO_SHOW_REGEXP_MATCH(self.name) and not self.network_play 
and \
                config.VIDEO_SHOW_DATA_DIR:
@@ -289,25 +298,10 @@
         return a list of possible actions on this item.
         """
 
-        self.possible_player = []
-        for p in plugin.getbyname(plugin.VIDEO_PLAYER, True):
-            rating = p.rate(self) * 10
-            if config.VIDEO_PREFERED_PLAYER == p.name:
-                rating += 1
-            if hasattr(self, 'force_player') and p.name == self.force_player:
-                rating += 100
-            self.possible_player.append((rating, p))
-
-        self.possible_player.sort(lambda l, o: -cmp(l[0], o[0]))
-
-        self.player        = None
-        self.player_rating = 0
 
         if not self.possible_player:
             return []
 
-        self.player_rating, self.player = self.possible_player[0]
-
         if self.url.startswith('dvd://') and self.url[-1] == '/':
             if self.player_rating >= 20:
                 items = [ (self.play, _('Play DVD')),
@@ -715,9 +709,11 @@
 ########################
 # Show Details
 
+import skin
 # Create the skin_object object
 skin_object = skin.get_singleton()
-skin_object.register('tvguideinfo', ('screen', 'info', 'scrollabletext', 
'plugin'))
+if skin_object:
+    skin_object.register('tvguideinfo', ('screen', 'info', 'scrollabletext', 
'plugin'))
 
 # Program Info screen
 class ShowDetails:
@@ -760,7 +756,8 @@
         # this activates the eventhandler and the context of this class
         rc.app(self)
 
-        skin_object.draw('tvguideinfo', self)
+        if skin_object:
+            skin_object.draw('tvguideinfo', self)
 
 
 

-------------------------------------------------------------------------
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