Fix albumartist

This commit is contained in:
angelblue05 2015-11-06 22:40:08 -06:00
parent d03d24d078
commit 9f4584d83f
1 changed files with 6 additions and 1 deletions

View File

@ -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]