Fix music album + logging

This commit is contained in:
angelblue05 2016-01-30 20:49:10 -06:00
parent 2928fd175e
commit 0cc6d36caa

View file

@ -2042,13 +2042,17 @@ class Music(Items):
return return
except TypeError: except TypeError:
# No album found. Let's create it # No album found. Let's create it
self.logMsg("Album database entry missing.", 1)
emby_albumId = item['AlbumId'] emby_albumId = item['AlbumId']
album = self.emby.getItem(emby_albumId) album = self.emby.getItem(emby_albumId)
self.add_updateAlbum(album)
emby_dbalbum = emby_db.getItem_byId(emby_albumId) emby_dbalbum = emby_db.getItem_byId(emby_albumId)
try: try:
albumid = emby_dbalbum[0] albumid = emby_dbalbum[0]
self.logMsg("Found albumid: %s" % albumid, 1)
except TypeError: except TypeError:
# No album found, create a single's album # No album found, create a single's album
self.logMsg("Failed to add album. Creating singles.", 1)
kodicursor.execute("select coalesce(max(idAlbum),0) from album") kodicursor.execute("select coalesce(max(idAlbum),0) from album")
albumid = kodicursor.fetchone()[0] + 1 albumid = kodicursor.fetchone()[0] + 1
if kodiversion == 16: if kodiversion == 16: