From ce508257a3ca925290334ed8d309949682de9187 Mon Sep 17 00:00:00 2001 From: croneter Date: Mon, 21 Aug 2017 19:42:41 +0200 Subject: [PATCH] Move Kodi DB check flag to state.py --- resources/lib/librarysync.py | 5 ++--- resources/lib/state.py | 2 ++ service.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index c56cd2b3..9b2f0ad2 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -1506,7 +1506,7 @@ class LibrarySync(Thread): return xbmc.sleep(1000) - if (window('plex_dbCheck') != "true" and installSyncDone): + if state.KODI_DB_CHECKED is False and installSyncDone: # Install sync was already done, don't force-show dialogs self.force_dialog = False # Verify the validity of the database @@ -1529,8 +1529,7 @@ class LibrarySync(Thread): else: reset() break - - window('plex_dbCheck', value="true") + state.KODI_DB_CHECKED = True if not startupComplete: # Also runs when first installed diff --git a/resources/lib/state.py b/resources/lib/state.py index 7a9cd8ef..f744fa0e 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -32,6 +32,8 @@ RUN_LIB_SCAN = None # Stemming from the PKC settings.xml # Shall we show Kodi dialogs when synching? SYNC_DIALOG = True +# Have we already checked the Kodi DB on consistency? +KODI_DB_CHECKED = False # Along with window('plex_authenticated') diff --git a/service.py b/service.py index e0990f92..0d2daf3a 100644 --- a/service.py +++ b/service.py @@ -107,7 +107,7 @@ class Service(): # Reset window props for profile switch properties = [ "plex_online", "plex_serverStatus", "plex_onWake", - "plex_dbCheck", "plex_kodiScan", + "plex_kodiScan", "plex_shouldStop", "plex_dbScan", "plex_initialScan", "plex_customplayqueue", "plex_playbackProps", "pms_token", "plex_token",