Author: duncan
Date: Mon Dec 25 22:34:43 2006
New Revision: 8806
Modified:
branches/rel-1/freevo/src/video/videoitem.py
Log:
runtime comes from the fxd file and is usually a number of minutes
This fix corrects this when 'minutes' is in the runtime data.
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 Mon Dec 25 22:34:43 2006
@@ -222,7 +222,14 @@
for s in self.subitems:
if s.info['runtime']:
length = s.info['runtime']
- elif s.info['length']:
+ try:
+ minpos = length.find('min') - 1
+ if minpos >= 0:
+ total = int(length[:minpos]) * 60
+ except TypeError:
+ pass
+ break
+ if s.info['length']:
length = s.info['length']
if not length and hasattr(s, 'length'):
length = s.length
@@ -230,7 +237,7 @@
continue
try:
total += length
- except ValueError:
+ except ValueError, TypeError:
pass
length = str(total / 60)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog