Ejemplo n.º 1
0
def get_all_releases(rgid, includeExtras=False):
    results = []
    try:
        limit = 100
        newResults = None
        while newResults == None or len(newResults) >= limit:
            newResults = musicbrainzngs.browse_releases(release_group=rgid,
                                                        includes=[
                                                            'artist-credits',
                                                            'labels',
                                                            'recordings',
                                                            'release-groups',
                                                            'media'
                                                        ],
                                                        limit=limit,
                                                        offset=len(results))
            if 'release-list' not in newResults:
                break  #may want to raise an exception here instead ?
            newResults = newResults['release-list']
            results += newResults

    except WebServiceError, e:
        logger.warn(
            'Attempt to retrieve information from MusicBrainz for release group "%s" failed (%s)'
            % (rgid, str(e)))
        time.sleep(5)
        return False
Ejemplo n.º 2
0
def get_all_releases(rgid,includeExtras=False):
    results = []
    try:
        limit = 100
        newResults = None
        while newResults == None or len(newResults) >= limit:
            newResults = musicbrainzngs.browse_releases(release_group=rgid,includes=['artist-credits','labels','recordings','release-groups','media'],limit=limit,offset=len(results))
            if 'release-list' not in newResults:
                break #may want to raise an exception here instead ?
            newResults = newResults['release-list']
            results += newResults
            
    except WebServiceError, e:
        logger.warn('Attempt to retrieve information from MusicBrainz for release group "%s" failed (%s)' % (rgid, str(e)))
        time.sleep(5)
        return False