Add fix for missing key

This commit is contained in:
angelblue05 2015-12-31 22:19:36 -06:00
parent 7a19f010dc
commit 227bb3eb42
2 changed files with 7 additions and 3 deletions

View file

@ -2280,10 +2280,14 @@ class Music(Items):
# Add path
pathid = kodi_db.addPath(path)
# Get the album
emby_dbalbum = emby_db.getItem_byId(item['AlbumId'])
try:
# Get the album
emby_dbalbum = emby_db.getItem_byId(item['AlbumId'])
albumid = emby_dbalbum[0]
except KeyError:
# No album Id associated to the song.
self.logMsg("Song itemid: %s has no albumId." % itemid, 1)
return
except TypeError:
# No album found, create a single's album
kodicursor.execute("select coalesce(max(idAlbum),0) from album")