getArtist now retrieves all albums, not just the first 25., filtering may have a few problems now, will do a thorough test run tomorrow.

This commit is contained in:
Patrick Speiser
2012-05-28 00:08:28 +02:00
parent c8cc29b1ab
commit 191d264951

View File

@@ -170,7 +170,13 @@ def getArtist(artistid, extrasonly=False):
while attempt < 5:
try:
artist = musicbrainzngs.get_artist_by_id(artistid,includes=["releases","release-groups"],release_status="official",release_type="album")['artist']
limit = 100
artist = musicbrainzngs.get_artist_by_id(artistid)['artist']
newRgs = None
artist['release-group-list'] = []
while newRgs == None or len(newRgs) >= limit:
newRgs = musicbrainzngs.browse_release_groups(artistid,release_type="album",offset=len(artist['release-group-list']),limit=limit)['release-group-list']
artist['release-group-list'] += newRgs
break
except WebServiceError, e:
logger.warn('Attempt to retrieve artist information from MusicBrainz failed for artistid: %s (%s)' % (artistid, str(e)))