Bugs item #1621220, was opened at 2006-12-23 11:53
Message generated for change (Comment added) made by duncanwebb
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1621220&group_id=46652

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: video
Group: 1.x svn (rel-1)
>Status: Pending
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Gorka Olaizola (gorka)
Assigned to: Nobody/Anonymous (nobody)
Summary: Sum length of subitems and manual aspect

Initial Comment:
The attached patch adds the length of the subitems to the runtime information 
and adds a manual calculated aspect ratio if the file has no embedded aspect 
ratio.
It also corrects the removal of the line x.files = FileInformation() that I 
thought it was not important but without it Freevo crashes when showing the 
submenu of an item with subitems.

----------------------------------------------------------------------

>Comment By: Duncan Webb (duncanwebb)
Date: 2006-12-27 00:00

Message:
Logged In: YES 
user_id=104395
Originator: NO

FileInformation() put back in rel-1 at r8814

----------------------------------------------------------------------

Comment By: Gorka Olaizola (gorka)
Date: 2006-12-26 21:28

Message:
Logged In: YES 
user_id=309801
Originator: YES

In r8812 I get this traceback when showing the submenu. The shoppingcart
plugin needs a method found in the FileInformation class.

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/freevo/main.py", line 285, in
eventhandler
    app.eventhandler(event)
  File "/usr/lib/python2.4/site-packages/freevo/menu.py", line 643, in
eventhandler
    for a in p.actions(menu.selected):
  File "/usr/lib/python2.4/site-packages/freevo/plugins/shoppingcart.py",
line 120, in actions
    elif hasattr(item, 'files') and item.files and
item.files.copy_possible() and \
AttributeError: 'list' object has no attribute 'copy_possible'


This patch corrects it:

--- src/video/__init__.py       (revision 8812)
+++ src/video/__init__.py       (working copy)
@@ -125,8 +125,8 @@
                         # create new name
                         name = file[:pos] + file[pos:].replace('1',
'1-%s' % end, 1)
                         x = VideoItem(name, parent)
+                        x.files = FileInformation()
                         x.set_url(file, True)
-                        x.files = []
                         for f in [ file ] + add_file:
                             x.files.append(f)
                             x.subitems.append(VideoItem(f, x))

----------------------------------------------------------------------

Comment By: Duncan Webb (duncanwebb)
Date: 2006-12-25 23:39

Message:
Logged In: YES 
user_id=104395
Originator: NO

Thanks, the correction is now in svn rel-1 at r8805.

I have just done a quick test, the runtime field comes directly from the
fxd file and AFAICS is a string of minutes. rel-1 has now been updated to
check this and break.

Here's an example that can cause this.
<?xml version="1.0" ?>
<freevo>
  <movie title="Video Sequence">
    <cover-img
source="http://url/to/cover/provider";>MyMovie.jpg</cover-img>
    <video>
      <file id="part01" name="My Video, Part 1">clips001.avi</file>
      <file id="part02" name="My Video, Part 2">clips003.avi</file>
      <file id="part03" name="My Video, Part 3">clips004.avi</file>
      <file id="part04" name="My Video, Part 4">clips005.avi</file>
      <file id="part05" name="My Video, Part 5">clips006.avi</file>
      <file id="part06" name="My Video, Part 6">clips007.avi</file>
      <file id="part07" name="My Video, Part 7">clips008.avi</file>
      <file id="part08" name="My Video, Part 8">clips009.avi</file>
      <file id="part09" name="My Video, Part 9">clips010.avi</file>
      <file id="part10" name="My Video, Part 10">clips011.avi</file>
      <file id="part11" name="My Video, Part 11">clips012.avi</file>
      <file id="part12" name="My Video, Part 12">clips013.avi</file>
      <file id="part13" name="My Video, Part 13">clips014.avi</file>
      <file id="part14" name="My Video, Part 14">clips015.avi</file>
      <file id="part15" name="My Video, Part 15">clips016.avi</file>
    </video>
    <info>
      <genre>Genre</genre>
      <runtime>123 minutes</runtime>
      <rating>8/10</rating>
      <tagline>The best movie ever!</tagline>
      <plot>Some video clips from my dv camera</plot>
    </info>
  </movie>
</freevo>


----------------------------------------------------------------------

Comment By: Gorka Olaizola (gorka)
Date: 2006-12-25 22:37

Message:
Logged In: YES 
user_id=309801
Originator: YES

Yes, the patch to the __init__.py file corrects those lines that now don't
work properly with virtual joined menu entries.

With "x.files = []", at least on my system, Freevo crashes when requesting
the submenu in a virtual joined menu entry.
I think the original line some revisions ago was "x.files =
FileInformation()", not x.files = []. The line "x.set_url(file, False)"
should be True also to show information about the joined files.

With the patch applied to the latest revision of rel-1 all works correctly
on my system.

----------------------------------------------------------------------

Comment By: Duncan Webb (duncanwebb)
Date: 2006-12-25 21:57

Message:
Logged In: YES 
user_id=104395
Originator: NO

- x.set_url(file, False)
+ x.set_url(file, True)

This part of the patch was rejected because I had spotted the removal of
x.files = FileInformation() and added the empty list back.

Is this is what is missing?

BTW you learn from the tips and I'm no Python expert either :) Wasn't
blaming anybody


----------------------------------------------------------------------

Comment By: Gorka Olaizola (gorka)
Date: 2006-12-25 14:45

Message:
Logged In: YES 
user_id=309801
Originator: YES

It seems that the part of the patch that modifies video/__init__.py is not
applied to r8796.

Thanks for the tips about better coding. I don't know too much python and
I've based my code in the one that is already written. The isinstance()
parts, and so, were in the code before I add my part. So blame another one
about bad coding :-D

----------------------------------------------------------------------

Comment By: Duncan Webb (duncanwebb)
Date: 2006-12-23 13:43

Message:
Logged In: YES 
user_id=104395
Originator: NO

Nice patch, thanks

The patch has been applied to rel-1 at r8794, with some minor
modifications.

You don't mind if I make some comments?
if s.info['runtime'] and s.info['runtime'] != 'None':
can be shortened to:
if s.info['runtime']:
because, while None is not the same as 0 (zero) they both evaluate to
False.

The if isinstance(): calls are simplier when they are try: except:
blocks.

tehe, unusually had spotted the x.files = [] error, should have mentioned
it. You may get a conflict when svn update is run.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1621220&group_id=46652

-------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to