From 9f4584d83f55ee67b8e6142142edc8dc4bcadc6d Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 6 Nov 2015 22:40:08 -0600 Subject: [PATCH] Fix albumartist --- resources/lib/WriteKodiMusicDB.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/lib/WriteKodiMusicDB.py b/resources/lib/WriteKodiMusicDB.py index c8570341..73fe8b87 100644 --- a/resources/lib/WriteKodiMusicDB.py +++ b/resources/lib/WriteKodiMusicDB.py @@ -332,7 +332,12 @@ class WriteKodiMusicDB(): cursor.execute(query, (albumid, artists, genre, year, dateadded)) finally: # Link album to artists - for artist in MBitem['ArtistItems']: + if MBitem['AlbumArtists']: + album_artists = MBitem['AlbumArtists'] + else: + album_artists = MBitem['ArtistItems'] + + for artist in album_artists: cursor.execute("SELECT kodi_id FROM emby WHERE emby_id = ?", (artist['Id'],)) try: artistid = cursor.fetchone()[0]