diff --git a/addon.xml b/addon.xml index 379a66d0..33a6b343 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/changelog.txt b/changelog.txt index ae3a8912..f1cc627c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +version 1.1.70 +- Include AirsAfterSeason for special episodes ordering +- Cover art settings - label adjusted. A reset or repair will be required if you change the settings value. +- Fix duplicate views being created (reset will be required) +- Fix albums merge when they had the same name (reset will be required) +- Minor fix to songs + version 1.1.69 - Fix unicode error for video nodes - Fix special episode ordering (repair sync can be run) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index cb2e2b31..1782a855 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -388,7 +388,7 @@ def refreshPlaylist(): lib.refreshViews() dialog.notification( heading="Emby for Kodi", - message="Emby playlist refreshed!", + message="Emby playlist refreshed", icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", time=1000, sound=False) @@ -396,8 +396,8 @@ def refreshPlaylist(): utils.logMsg("EMBY", "Refresh playlist failed: %s" % e, 1) dialog.notification( heading="Emby for Kodi", - message="Emby playlist refresh failed!", - icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", + message="Emby playlist refresh failed", + icon=xbmcgui.NOTIFICATION_ERROR, time=1000, sound=False) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 47c2d621..c5bce843 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -2260,10 +2260,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") diff --git a/resources/lib/kodidb_functions.py b/resources/lib/kodidb_functions.py index a5f6a5d0..687c485e 100644 --- a/resources/lib/kodidb_functions.py +++ b/resources/lib/kodidb_functions.py @@ -1050,29 +1050,17 @@ class Kodidb_Functions(): try: albumid = cursor.fetchone()[0] except TypeError: - # Verify by name - query = ' '.join(( + # Create the album + cursor.execute("select coalesce(max(idAlbum),0) from album") + albumid = cursor.fetchone()[0] + 1 + query = ( + ''' + INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID) - "SELECT idAlbum", - "FROM album", - "WHERE strAlbum = ?", - "COLLATE NOCASE" - )) - cursor.execute(query, (name,)) - try: - albumid = cursor.fetchone()[0] - except TypeError: - # Create the album - cursor.execute("select coalesce(max(idAlbum),0) from album") - albumid = cursor.fetchone()[0] + 1 - query = ( - ''' - INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID) - - VALUES (?, ?, ?) - ''' - ) - cursor.execute(query, (albumid, name, musicbrainz)) + VALUES (?, ?, ?) + ''' + ) + cursor.execute(query, (albumid, name, musicbrainz)) return albumid diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index de5808c6..fe22a270 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -63,7 +63,7 @@ class KodiMonitor(xbmc.Monitor): self.logMsg("Properties already set for item.", 1) else: if ((utils.settings('useDirectPaths') == "1" and not type == "song") or - (type == "song" and utils.settings('disableMusic') == "false")): + (type == "song" and utils.settings('enableMusic') == "true")): # Set up properties for player embyconn = utils.kodiSQL('emby') embycursor = embyconn.cursor() diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 7fc080ce..787f27f9 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -303,7 +303,7 @@ class LibrarySync(threading.Thread): utils.window('emby_dbScan', clear=True) xbmcgui.Dialog().notification( heading="Emby for Kodi", - message="%s completed in: %s!" % + message="%s completed in: %s" % (message, str(elapsedtotal).split('.')[0]), icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", sound=False) @@ -376,7 +376,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 diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 932d4bbd..ed9ba40b 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -158,7 +158,7 @@ def reset(): connection.commit() cursor.close() - if settings('disableMusic') != "true": + if settings('enableMusic') == "true": logMsg("EMBY", "Resetting the Kodi music database.") connection = kodiSQL('music') cursor = connection.cursor() @@ -376,7 +376,7 @@ def passwordsXML(): settings('networkCreds', value="") xbmcgui.Dialog().notification( heading="Emby for Kodi", - message="%s removed from passwords.xml!" % credentials, + message="%s removed from passwords.xml" % credentials, icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", time=1000, sound=False) @@ -435,7 +435,7 @@ def passwordsXML(): dialog.notification( heading="Emby for Kodi", - message="%s added to passwords.xml!" % server, + message="%s added to passwords.xml" % server, icon="special://home/addons/plugin.video.plexkodiconnect/icon.png", time=1000, sound=False)