After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 411038 - jamendo plugin isn't error-proof enough
jamendo plugin isn't error-proof enough
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Plugins (other)
0.9.8
Other All
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-23 00:27 UTC by Max Wiehle
Modified: 2007-02-25 05:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple patch which fixes the issue (2.21 KB, patch)
2007-02-23 13:33 UTC, Snark
committed Details | Review

Description Max Wiehle 2007-02-23 00:27:38 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):
  • File "/usr/lib/rhythmbox/plugins/jamendo/JamendoSource.py", line 162 in finish_loadscreen
    self.__load_db ()
  • File "/usr/lib/rhythmbox/plugins/jamendo/JamendoSource.py", line 300 in __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:
Comment 1 Laurent Bigonville 2007-02-23 02:00:48 UTC
Same problem here
Comment 2 Snark 2007-02-23 10:09:40 UTC
Let me add my "me too" ;-)
Comment 3 Snark 2007-02-23 10:24:31 UTC
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>
Comment 4 Snark 2007-02-23 10:50:32 UTC
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):
  • File "JamendoSaxHandler.py", line 150 in ?
    album = albums[track['albumID']]
KeyError: u'4349'

Comment 5 Snark 2007-02-23 12:33:58 UTC
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 ;-)
Comment 6 Snark 2007-02-23 13:18:42 UTC
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.
Comment 7 Snark 2007-02-23 13:33:18 UTC
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.
Comment 8 Guillaume Desmottes 2007-02-23 13:49:54 UTC
Thank you very much for your patch Julien. :)
Comment 9 Guillaume Desmottes 2007-02-23 16:36:15 UTC
The XML file was fixed by Jamendo. Anyway, we should integrate this patch to made the code more robust.
Comment 10 Max Wiehle 2007-02-23 16:42:21 UTC
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.
Comment 11 James "Doc" Livingston 2007-02-25 05:04:29 UTC
Committed to SVN on trunk and the stable branch.