mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
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
|
||||
pathid = kodi_db.addPath(path)
|
||||
|
||||
try:
|
||||
# Get the album
|
||||
emby_dbalbum = emby_db.getItem_byId(item['AlbumId'])
|
||||
try:
|
||||
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")
|
||||
|
|
|
@ -358,7 +358,7 @@ class LibrarySync(threading.Thread):
|
|||
# Media folders are grouped into userview
|
||||
for grouped_view in grouped_views:
|
||||
if (grouped_view['Type'] == "UserView" and
|
||||
grouped_view['CollectionType'] == mediatype):
|
||||
grouped_view.get('CollectionType') == mediatype):
|
||||
# Take the name of the userview
|
||||
foldername = grouped_view['Name']
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue