From fbb641328766a599f01f0dce4935922bd871dd57 Mon Sep 17 00:00:00 2001 From: theguardian Date: Tue, 10 Dec 2013 13:53:55 -0800 Subject: [PATCH] Fixed bug where specific releases would not show disambiguation in track title. Releases should now be WYSIWYG reflection of musicbrainz.org (with the exception of multiple disc releases to be handled next). --- headphones/mb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/headphones/mb.py b/headphones/mb.py index 8356769b..ca66ecc0 100644 --- a/headphones/mb.py +++ b/headphones/mb.py @@ -486,9 +486,13 @@ def getTracksFromRelease(release): tracks = [] for medium in release['medium-list']: for track in medium['track-list']: + try: + track_title = unicode(track['title']) + except: + track_title = unicode(track['recording']['title']) tracks.append({ 'number': totalTracks, - 'title': unicode(track['recording']['title']), + 'title': track_title, 'id': unicode(track['recording']['id']), 'url': u"http://musicbrainz.org/track/" + track['recording']['id'], 'duration': int(track['length']) if 'length' in track else 0