Add fix for missing key
This commit is contained in:
parent
7a19f010dc
commit
227bb3eb42
2 changed files with 7 additions and 3 deletions
|
@ -2280,10 +2280,14 @@ class Music(Items):
|
||||||
# Add path
|
# Add path
|
||||||
pathid = kodi_db.addPath(path)
|
pathid = kodi_db.addPath(path)
|
||||||
|
|
||||||
# Get the album
|
|
||||||
emby_dbalbum = emby_db.getItem_byId(item['AlbumId'])
|
|
||||||
try:
|
try:
|
||||||
|
# Get the album
|
||||||
|
emby_dbalbum = emby_db.getItem_byId(item['AlbumId'])
|
||||||
albumid = emby_dbalbum[0]
|
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:
|
except TypeError:
|
||||||
# No album found, create a single's album
|
# No album found, create a single's album
|
||||||
kodicursor.execute("select coalesce(max(idAlbum),0) from album")
|
kodicursor.execute("select coalesce(max(idAlbum),0) from album")
|
||||||
|
|
|
@ -358,7 +358,7 @@ class LibrarySync(threading.Thread):
|
||||||
# Media folders are grouped into userview
|
# Media folders are grouped into userview
|
||||||
for grouped_view in grouped_views:
|
for grouped_view in grouped_views:
|
||||||
if (grouped_view['Type'] == "UserView" and
|
if (grouped_view['Type'] == "UserView" and
|
||||||
grouped_view['CollectionType'] == mediatype):
|
grouped_view.get('CollectionType') == mediatype):
|
||||||
# Take the name of the userview
|
# Take the name of the userview
|
||||||
foldername = grouped_view['Name']
|
foldername = grouped_view['Name']
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue