Author: duncan
Date: Wed Aug 22 16:05:40 2007
New Revision: 9842

Log:
Fixed an error report when self.possible_player has not been set
The length really does need to be initialised for multi-part fxd files
-This line, and those below, will be ignored--

M    videoitem.py


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        Wed Aug 22 16:05:40 2007
@@ -101,7 +101,8 @@
                 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]
+        if len(self.possible_player) > 0:
+            self.player_rating, self.player = self.possible_player[0]
 
 
         # find image for tv show and build new title
@@ -246,16 +247,14 @@
             total = 0
             if self.subitems:
                 for s in self.subitems:
+                    length = 0
                     if s.info['length']:
                         length = s.info['length']
                     if not length and hasattr(s, 'length'):
                         length = s.length
                     if not length:
                         continue
-                    try:
-                        total += length
-                    except ValueError, TypeError:
-                        pass
+                    total += length
                 total = '%s min' % str(int(total) / 60)
 
             else:

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