From 888e5f2989c6cbd91060f4e0def1fdc909f2b46a Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 17 Aug 2015 18:24:07 -0500 Subject: [PATCH] Fix for userdata Forgot the music check for the database check. --- resources/lib/LibrarySync.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index 2a436bd2..b5957afb 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -854,6 +854,7 @@ class LibrarySync(threading.Thread): def setUserdata(self, listItems): dbSyncIndication = utils.settings("dbSyncIndication") == "true" + musicenabled = utils.settings('enableMusicSync') == "true" #show the progress dialog pDialog = None @@ -890,12 +891,15 @@ class LibrarySync(threading.Thread): mediatype = cursorvideo.fetchone()[0] video.append(userdata) except: - cursormusic.execute("SELECT media_type FROM emby WHERE emby_id = ?", (itemId,)) - try: # Search music database - self.logMsg("Check the music database.", 1) - mediatype = cursormusic.fetchone()[0] - music.append(userdata) - except: self.logMsg("Item %s is not found in Kodi database." % itemId, 2) + if musicenabled: + cursormusic.execute("SELECT media_type FROM emby WHERE emby_id = ?", (itemId,)) + try: # Search music database + self.logMsg("Check the music database.", 1) + mediatype = cursormusic.fetchone()[0] + music.append(userdata) + except: self.logMsg("Item %s is not found in Kodi database." % itemId, 2) + else: + self.logMsg("Item %s is not found in Kodi database." % itemId, 2) if len(video) > 0: connection = connectionvideo @@ -922,7 +926,6 @@ class LibrarySync(threading.Thread): #Process music library count = 1 total = len(video) + 1 - musicenabled = utils.settings('enableMusicSync') == "true" # Process the userdata update for music library if musicenabled: for userdata in music: