def match_library(local_artist_list): available_artwork = [] try: for artist in local_artist_list: artist_artwork = {} if not artist["musicbrainz_artistid"]: name, artist[ "musicbrainz_artistid"], sortname = get_musicbrainz_artist_id( artist["name"]) if artist["musicbrainz_artistid"]: artwork = retrieve_fanarttv_xml(artist["musicbrainz_artistid"]) if artwork: artist_artwork["name"] = artist["name"] artist_artwork["musicbrainz_id"] = artist[ "musicbrainz_artistid"] artist_artwork["artwork"] = artwork available_artwork.append(artist_artwork) else: log( "Unable to match artist on fanart.tv: %s" % artist["name"], xbmc.LOGDEBUG) else: log( "Unable to match artist on Musicbrainz: %s" % artist["name"], xbmc.LOGDEBUG) except: print_exc() return available_artwork
def artist_musicbrainz_id( artist_id, artist_mbid ): artist_details = retrieve_artist_details( artist_id ) artist = [] if not artist_details["musicbrainzartistid"] or not artist_mbid: name, artist["musicbrainz_artistid"], sortname = get_musicbrainz_artist_id( get_unicode( artist_details["label"] ) ) artist[ "name" ] = get_unicode( artist_details[ "label" ] ) else: artist[ "name" ] = get_unicode( artist_details["label"] ) if artist_mbid: artist[ "musicbrainz_artistid" ] = artist_mbid else: artist[ "musicbrainz_artistid" ] = artist_details["musicbrainzartistid"] return artist
def match_library( local_artist_list ): available_artwork = [] try: for artist in local_artist_list: artist_artwork = {} if not artist["musicbrainz_artistid"]: name, artist["musicbrainz_artistid"], sortname = get_musicbrainz_artist_id( artist["name"] ) if artist["musicbrainz_artistid"]: artwork = retrieve_fanarttv_xml( artist["musicbrainz_artistid"] ) if artwork: artist_artwork["name"] = artist["name"] artist_artwork["musicbrainz_id"] = artist["musicbrainz_artistid"] artist_artwork["artwork"] = artwork available_artwork.append(artist_artwork) else: log( "Unable to match artist on fanart.tv: %s" % artist["name"], xbmc.LOGDEBUG ) else: log( "Unable to match artist on Musicbrainz: %s" % artist["name"], xbmc.LOGDEBUG ) except: print_exc() return available_artwork