IndexError: list index out of range

Bug #694196 reported by crotalus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Viridian
Fix Released
Medium
Dave Eddy

Bug Description

When I click on an artist, I get 98% of the time:

This artist failed 0
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/AmpacheTools/AmpacheSession.py", line 360, in get_albums_by_artist
    album_disk = int(child.getElementsByTagName('disk')[0].childNodes[0].data)
IndexError: list index out of range

I am using ampache 3.5.4, but the same happened to ampache 3.6 alpha1.

I few artists succeed, and I can play whatever song are shown on the dialog area.

Of course, my ampache installation is working fine. This is on a Fedora 14.

Thanks.

Revision history for this message
Dave Eddy (daveeddydotcom) wrote :

Which version of viridian are you using/how did you install it?

Revision history for this message
crotalus (promac) wrote :

Viridian 1.1.1

I created an rpm for it, but also running it without installing,
the result is the same.

I was hoping to make Viridian available for the Fedora community.

Thanks.

Changed in viridianplayer:
importance: Undecided → Medium
assignee: nobody → Dave Eddy (daveeddydotcom)
Revision history for this message
Dave Eddy (daveeddydotcom) wrote :

Well i'm glad to see Viridian being made available to the fedora community!

This issue seems to be something that I have dealt with with Ampache before, and it is an issue with the XML being returned from Ampache and the XML parser I'm using for Viridian breaking. I will commit a fix for this issue after the holidays, but for now if you would like to fix this issue it can most likely be fixed by finding the line in AmpacheSession.py that looks like this...

album_disk = int(child.getElementsByTagName('disk')[0].childNodes[0].data)

and replacing it with this

try:
        album_disk = int(child.getElementsByTagName('disk')[0].childNodes[0].data)
except:
        album_disk = 0

Revision history for this message
crotalus (promac) wrote :

That is it! It is working just fine now.

I have the patched source rpm available here:

http://people.atrpms.net/~pcavalcanti/srpms/viridian-1.1.1-1.fc14.src.rpm

and the spec file, here:

http://people.atrpms.net/~pcavalcanti/specs/viridian.spec

Thanks.

Revision history for this message
crotalus (promac) wrote :

Viridian can be downloaded for Fedora/Rhel, from ATrpms:

http://packages.atrpms.net/name/viridian/

Thanks.

Revision history for this message
Dave Eddy (daveeddydotcom) wrote :

That's awesome thank you!

Revision history for this message
Dave Eddy (daveeddydotcom) wrote :

I have added this patch to the newest release, version 1.2

Changed in viridianplayer:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.