From 5394b1adc39966e91ae74cf00af3023cf8bbe1a4 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 8 Sep 2018 15:04:32 -0500 Subject: [PATCH] Fix artists --- resources/lib/objects/music.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/lib/objects/music.py b/resources/lib/objects/music.py index 05108bb7..1dacd0f5 100644 --- a/resources/lib/objects/music.py +++ b/resources/lib/objects/music.py @@ -186,7 +186,7 @@ class Music(KodiDb): ''' Update the artist's discography. ''' - for artist in obj['ArtistItems']: + for artist in (obj['ArtistItems'] or []): temp_obj = dict(obj) temp_obj['Id'] = artist['Id'] @@ -206,7 +206,7 @@ class Music(KodiDb): ''' Assign main artists to album. Artist does not exist in emby database, create the reference. ''' - for artist in obj['AlbumArtists']: + for artist in (obj['AlbumArtists'] or []): temp_obj = dict(obj) temp_obj['Name'] = artist['Name'] @@ -358,7 +358,7 @@ class Music(KodiDb): ''' Update the artist's discography. ''' artists = [] - for artist in obj['AlbumArtists']: + for artist in (obj['AlbumArtists'] or []): temp_obj = dict(obj) temp_obj['Name'] = artist['Name'] @@ -391,7 +391,7 @@ class Music(KodiDb): ''' Assign main artists to song. Artist does not exist in emby database, create the reference. ''' - for index, artist in enumerate(obj['ArtistItems']): + for index, artist in enumerate(obj['ArtistItems'] or []): temp_obj = dict(obj) temp_obj['Name'] = artist['Name']