From 1788470dcfda81d4a584935134da61be24a1026d Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 28 Feb 2010 19:02:03 +0000 Subject: [PATCH] * morituri/common/program.py: Fix a problem with Arid's new album of not having an id. --- ChangeLog | 5 +++++ morituri/common/program.py | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7c3ef82..e1f1298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-28 Thomas Vander Stichele + + * morituri/common/program.py: + Fix a problem with Arid's new album of not having an id. + 2010-01-31 Thomas Vander Stichele * morituri/common/accurip.py: diff --git a/morituri/common/program.py b/morituri/common/program.py index 2bf11e3..7828065 100644 --- a/morituri/common/program.py +++ b/morituri/common/program.py @@ -60,6 +60,9 @@ def filterForPath(text): return "-".join(text.split("/")) def getMetadata(release): + """ + @rtype: L{DiscMetadata} + """ metadata = DiscMetadata() isSingleArtist = release.isSingleArtistRelease() @@ -84,6 +87,9 @@ def getMetadata(release): def musicbrainz(discid): + """ + @rtype: list of L{DiscMetadata} + """ #import musicbrainz2.disc as mbdisc import musicbrainz2.webservice as mbws @@ -110,12 +116,16 @@ def musicbrainz(discid): for result in results: release = result.release + log.debug('program', 'result: artist %r, title %r' % ( + release.artist.getName(), release.title)) # The returned release object only contains title and artist, but no # tracks. Query the web service once again to get all data we need. try: inc = mbws.ReleaseIncludes(artist=True, tracks=True, releaseEvents=True) - release = query.getReleaseById(release.getId(), inc) + # Arid - Under the Cold Street Lights has getId() None + if release.getId(): + release = query.getReleaseById(release.getId(), inc) except mbws.WebServiceError, e: raise MusicBrainzException(e)