Use some file settings instead of window settings
- In case the user changes something while PKC is running
This commit is contained in:
parent
a2a53cddf6
commit
a3d643c643
4 changed files with 7 additions and 30 deletions
|
@ -2515,16 +2515,16 @@ class API():
|
|||
'photo': 'photo'
|
||||
}
|
||||
typus = types[typus]
|
||||
if window('remapSMB') == 'true':
|
||||
path = path.replace(window('remapSMB%sOrg' % typus),
|
||||
window('remapSMB%sNew' % typus),
|
||||
if settings('remapSMB') == 'true':
|
||||
path = path.replace(settings('remapSMB%sOrg' % typus),
|
||||
settings('remapSMB%sNew' % typus),
|
||||
1)
|
||||
# There might be backslashes left over:
|
||||
path = path.replace('\\', '/')
|
||||
elif window('replaceSMB') == 'true':
|
||||
elif settings('replaceSMB') == 'true':
|
||||
if path.startswith('\\\\'):
|
||||
path = 'smb:' + path.replace('\\', '/')
|
||||
if window('plex_pathverified') == 'true' and forceCheck is False:
|
||||
if settings('plex_pathverified') == 'true' and forceCheck is False:
|
||||
return path
|
||||
|
||||
# exist() needs a / or \ at the end to work for directories
|
||||
|
@ -2545,13 +2545,12 @@ class API():
|
|||
if self.askToValidate(path):
|
||||
window('plex_shouldStop', value="true")
|
||||
path = None
|
||||
window('plex_pathverified', value='true')
|
||||
settings('plex_pathverified', value='true')
|
||||
settings('plex_pathverified', value='true')
|
||||
else:
|
||||
path = None
|
||||
elif forceCheck is False:
|
||||
if window('plex_pathverified') != 'true':
|
||||
window('plex_pathverified', value='true')
|
||||
if settings('plex_pathverified') != 'true':
|
||||
settings('plex_pathverified', value='true')
|
||||
return path
|
||||
|
||||
|
|
|
@ -399,9 +399,6 @@ class LibrarySync(Thread):
|
|||
'enableBackgroundSync') == "true"
|
||||
self.limitindex = int(settings('limitindex'))
|
||||
|
||||
if settings('plex_pathverified') == 'true':
|
||||
window('plex_pathverified', value='true')
|
||||
|
||||
# Just in case a time sync goes wrong
|
||||
self.timeoffset = int(settings('kodiplextimeoffset'))
|
||||
window('kodiplextimeoffset', value=str(self.timeoffset))
|
||||
|
|
|
@ -178,22 +178,6 @@ class UserClient(threading.Thread):
|
|||
|
||||
window('useDirectPaths', value='true'
|
||||
if settings('useDirectPaths') == "1" else 'false')
|
||||
window('replaceSMB', value='true'
|
||||
if settings('replaceSMB') == "true" else 'false')
|
||||
window('remapSMB', value='true'
|
||||
if settings('remapSMB') == "true" else 'false')
|
||||
if window('remapSMB') == 'true':
|
||||
items = ('movie', 'tv', 'music')
|
||||
for item in items:
|
||||
# Normalize! Get rid of potential (back)slashes at the end
|
||||
org = settings('remapSMB%sOrg' % item)
|
||||
new = settings('remapSMB%sNew' % item)
|
||||
if org.endswith('\\') or org.endswith('/'):
|
||||
org = org[:-1]
|
||||
if new.endswith('\\') or new.endswith('/'):
|
||||
new = new[:-1]
|
||||
window('remapSMB%sOrg' % item, value=org)
|
||||
window('remapSMB%sNew' % item, value=new)
|
||||
|
||||
# Start DownloadUtils session
|
||||
doUtils.startSession(reset=True)
|
||||
|
|
|
@ -97,9 +97,6 @@ class Service():
|
|||
"plex_runLibScan", "plex_username", "pms_token", "plex_token",
|
||||
"pms_server", "plex_machineIdentifier", "plex_servername",
|
||||
"plex_authenticated", "PlexUserImage", "useDirectPaths",
|
||||
"replaceSMB", "remapSMB", "remapSMBmovieOrg", "remapSMBtvOrg",
|
||||
"remapSMBmusicOrg", "remapSMBmovieNew", "remapSMBtvNew",
|
||||
"remapSMBmusicNew", "remapSMBphotoOrg", "remapSMBphotoNew",
|
||||
"suspend_LibraryThread", "plex_terminateNow",
|
||||
"kodiplextimeoffset", "countError", "countUnauthorized"
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue