GNOME Bugzilla – Bug 411038
jamendo plugin isn't error-proof enough
Last modified: 2007-02-25 05:04:29 UTC
Please describe the problem: I just compiled the latest release as well as svn head but i don't get the jamendo plugin to work. It won't show more than a welcome to jamendo screen. I can play jamendo tracks though - but i can't select them from a list. rhythmbox prints: Traceback (most recent call last):
+ Trace 113082
self.__load_db ()
album = albums[track['albumID']] KeyError: u'4349'
Steps to reproduce: 1. download current svn, 9.8 or edgy package from www.getdeb.net 2. compile and run 3. enable jamendo plugin wait... Actual results: Just shows the Jamendo page explaining what it si and 0 titles in the status bar Expected results: Display the list of artists, albums songs and a huge number of titles in the status bar Does this happen every time? yes. also tested on a fresh user account Other information:
Same problem here
Let me add my "me too" ;-)
Here is all the album_id=4349 tracks I can find in .gnome2/rhythmbox/jamendo/dbdump.en.xml : <track lengths="246" albumID="4349" trackno="1" link="http://www.jamendo.com/track/35755/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35755"><dispname>Useless Life</dispname><lyrics></lyrics></track> <track lengths="246" albumID="4349" trackno="2" link="http://www.jamendo.com/track/35756/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35756"><dispname>A New Life Begin</dispname><lyrics></lyrics></track> <track lengths="136" albumID="4349" trackno="3" link="http://www.jamendo.com/track/35757/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35757"><dispname>My Muse [Part 1]</dispname><lyrics></lyrics></track> <track lengths="262" albumID="4349" trackno="4" link="http://www.jamendo.com/track/35758/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35758"><dispname>My Muse [Part 2]</dispname><lyrics></lyrics></track> <track lengths="281" albumID="4349" trackno="5" link="http://www.jamendo.com/track/35759/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35759"><dispname>Abyssal Thing</dispname><lyrics></lyrics></track> <track lengths="220" albumID="4349" trackno="6" link="http://www.jamendo.com/track/35760/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35760"><dispname>Through your mind</dispname><lyrics></lyrics></track> <track lengths="201" albumID="4349" trackno="7" link="http://www.jamendo.com/track/35761/" licenseURL="http://creativecommons.org/licenses/by-nc-sa/2.5/" id="35761"><dispname>I'm Back</dispname><lyrics></lyrics></track>
I tried to copy my dbdump.en.xml to /tmp and run JamendoSaxHandler.py directly on it : $ python JamendoSaxHandler.py > /dev/null Traceback (most recent call last):
+ Trace 113175
album = albums[track['albumID']]
Reading about the error on http://wiki.python.org/moin/KeyError, I wonder why the code doesn't use the get() method... Btw, since cassidy confirmed he had the problem too (on #gnomefr), then I guess that confirms the bug ;-)
I didn't find any album with id="4349" in my dbdump.en.xml, so I guess the problem is that the file is incoherent. Probably some of the plugin has to use the get() method and check for the result, so it doesn't just silently fail when there's an error like this. Changing the summary to reflect this.
Created attachment 83168 [details] [review] Simple patch which fixes the issue Ok, this patch replaces a few "bar=foo[thing]" with "bar=foo.get(thing)", and afterwards does things like "if bar != None:" ; which explains why it's so long : most of it is just tabulating existing code.
Thank you very much for your patch Julien. :)
The XML file was fixed by Jamendo. Anyway, we should integrate this patch to made the code more robust.
Wow. That's what i love about free software... - it comes with great new features - they don't work 100% - you submit a bugreport - within 24 they are fixed - the fix also improves stability and fixes some problems in other places - you can use the new features and wait for the next ones. With propriatary software you can be happy to get the first two ;) Thanks a lot.
Committed to SVN on trunk and the stable branch.