Move path-checked flag to state.py

This commit is contained in:
croneter 2017-08-19 15:03:19 +02:00
parent a41e6ce821
commit d5c92f89d9
3 changed files with 7 additions and 4 deletions

View File

@ -2589,7 +2589,7 @@ class API():
elif window('replaceSMB') == 'true':
if path.startswith('\\\\'):
path = 'smb:' + path.replace('\\', '/')
if ((window('plex_pathverified') == 'true' and forceCheck is False) or
if ((state.PATH_VERIFIED and forceCheck is False) or
omitCheck is True):
return path
@ -2617,12 +2617,12 @@ class API():
if self.askToValidate(path):
state.STOP_SYNC = True
path = None
window('plex_pathverified', value='true')
state.PATH_VERIFIED = True
else:
path = None
elif forceCheck is False:
if window('plex_pathverified') != 'true':
window('plex_pathverified', value='true')
# Only set the flag if we were not force-checking the path
state.PATH_VERIFIED = True
return path
def askToValidate(self, url):

View File

@ -50,6 +50,7 @@ class KodiMonitor(Monitor):
# Assume that the user changed the settings so that we can now find the
# path to all media files
state.STOP_SYNC = False
state.PATH_VERIFIED = False
# settings: window-variable
items = {
'logLevel': 'plex_logLevel',

View File

@ -10,6 +10,8 @@ STOP_PKC = False
SUSPEND_LIBRARY_THREAD = False
# Set if user decided to cancel sync
STOP_SYNC = False
# Could we access the paths?
PATH_VERIFIED = False
# Set if a Plex-Kodi DB sync is being done - along with
# window('plex_dbScan') set to 'true'
DB_SCAN = False