amazoncovers can't find covers for tracks with multiple 'artist' tags

Bug #402649 reported by Johannes Sasongko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Adam Olsen

Bug Description

Test case:

1. Enable amazoncovers.
2. Make a track with two artist tags. (Should also work with multiple album tags.) Exaile normally displays such tags as "Tag 1 / Tag 2".
3. Play it.

Result:

Track plays, but the following error happens while trying to search for covers.

  File "/exaile/xlgui/cover.py", line 434, in on_playback_start
    update_track=True)
  File "/exaile/xl/cover.py", line 358, in get_cover
    covers = self.find_covers(track, limit=1)
  File "/exaile/xl/cover.py", line 398, in find_covers
    c = method.find_covers(track, limit)
  File "/exaile/data/plugins/amazoncovers/__init__.py", line 38, in find_covers
    (artist, album), limit)
  File "/exaile/data/plugins/amazoncovers/__init__.py", line 51, in search_covers
    ResponseGroup="ItemAttributes,Images")
  File "/exaile/data/plugins/amazoncovers/_ecs.py", line 341, in ItemSearch
    return pagedIterator(XMLItemSearch, argv, "ItemPage", 'Items', plugins)
  File "/exaile/data/plugins/amazoncovers/_ecs.py", line 218, in __init__
    dom = self.__search(** self.__arguments)
  File "/exaile/data/plugins/amazoncovers/_ecs.py", line 350, in XMLItemSearch
    return query(buildRequest(argv))
  File "/exaile/data/plugins/amazoncovers/_ecs.py", line 171, in query
    dom = minidom.parse(usock)
  File "/usr/lib/python2.6/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 928, in parse
    result = builder.parseFile(file)
  File "/usr/lib/python2.6/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
ExpatError: not well-formed (invalid token): line 1, column 651

Reason:

1. amazoncovers calls Track.get_album_tuple to get an (artist, album) tuple.
2. get_album_tuple calls metadata.j to join multiple tags with the same name.
3. metadata.j joins them using NUL.
4. minidom explodes while parsing Amazon's reply containing the original NUL.

Credits: Steve Dodier reported a symptom of the bug in #exaile.

Changed in exaile:
assignee: nobody → Exaile Bug Day Events (exaile-bugday)
Changed in exaile:
milestone: none → 0.3.0.1
Revision history for this message
reacocard (reacocard) wrote :

retargeting to 0.3.0.2

Changed in exaile:
milestone: 0.3.0.1 → 0.3.0.2
Changed in exaile:
assignee: Exaile Bug Day Events (exaile-bugday) → nobody
Revision history for this message
Adam Olsen (arolsen) wrote :

Fix committed in r2446

Changed in exaile:
assignee: nobody → Adam Olsen (arolsen)
status: Confirmed → Fix Committed
reacocard (reacocard)
Changed in exaile:
status: Fix Committed → 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.