def music_top_artists(page): results = lastfm.get_top_artists(page) artists = results["artists"]["artist"] items = [] for artist in artists: large_image = artist["image"][-1]["#text"] name = to_utf8(artist["name"]) context_menu = [ ( _("Scan item to library"), "RunPlugin({0})".format(plugin.url_for("music_add_artist_to_library", artist_name=name)) ) ] item = { 'label': name, 'path': plugin.url_for("music_artist_albums", artist_name=name), 'thumbnail': large_image, 'icon': "DefaultMusic.png", 'poster': large_image, 'info': { 'artist': name, }, 'info_type': 'music', 'context_menu': context_menu } items.append(item) if FORCE == True: plugin.set_view_mode(VIEW); return items else: return items
def music_top_artists(page): results = lastfm.get_top_artists(page) artists = results["artists"]["artist"] items = [] for artist in artists: large_image = artist["image"][-1]["#text"] name = to_utf8(artist["name"]) context_menu = [(_("Scan item to library"), "RunPlugin({0})".format( plugin.url_for("music_add_artist_to_library", artist_name=name)))] item = { 'label': name, 'path': plugin.url_for("music_artist_albums", artist_name=name), 'thumbnail': large_image, 'icon': "DefaultMusic.png", 'poster': large_image, 'info': { 'artist': name, }, 'info_type': 'music', 'context_menu': context_menu } items.append(item) if FORCE == True: plugin.set_view_mode(VIEW) return items else: return items
def music_top_artists(page): results = lastfm.get_top_artists(page) artists = results["artists"]["artist"] items = [] for artist in artists: large_image = artist["image"][-1]["#text"] name = to_utf8(artist["name"]) context_menu = [ ( _("Add to library"), "RunPlugin({0})".format(plugin.url_for("music_add_artist_to_library", artist_name=name)), ) ] item = { "label": name, "path": plugin.url_for(music_artist_albums, artist_name=name), "thumbnail": large_image, "icon": "DefaultMusic.png", "poster": large_image, "info": {"artist": name}, "info_type": "music", "context_menu": context_menu, } items.append(item) return items