From 191d2649515385e922ce6094e6ea4d54f0bfce37 Mon Sep 17 00:00:00 2001 From: Patrick Speiser Date: Mon, 28 May 2012 00:08:28 +0200 Subject: [PATCH] getArtist now retrieves all albums, not just the first 25., filtering may have a few problems now, will do a thorough test run tomorrow. --- headphones/mb.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/headphones/mb.py b/headphones/mb.py index a8a33bd6..d02e4ed8 100644 --- a/headphones/mb.py +++ b/headphones/mb.py @@ -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)))