From 3d7caec69a5552add81b05422dd6c5b87e67706f Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 6 May 2017 17:22:29 +0200 Subject: [PATCH] Don't verify detected music paths --- resources/lib/PlexAPI.py | 7 +++++-- resources/lib/music.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index e50760f5..1c53396d 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -2509,7 +2509,8 @@ class API(): listItem.addStreamInfo( "video", {'duration': self.getRuntime()[1]}) - def validatePlayurl(self, path, typus, forceCheck=False, folder=False): + def validatePlayurl(self, path, typus, forceCheck=False, folder=False, + omitCheck=False): """ Returns a valid path for Kodi, e.g. with '\' substituted to '\\' in Unicode. Returns None if this is not possible @@ -2519,6 +2520,7 @@ class API(): forceCheck : Will always try to check validity of path Will also skip confirmation dialog if path not found folder : Set to True if path is a folder + omitCheck : Will entirely omit validity check if True """ if path is None: return None @@ -2532,7 +2534,8 @@ class API(): elif window('replaceSMB') == 'true': if path.startswith('\\\\'): path = 'smb:' + path.replace('\\', '/') - if window('plex_pathverified') == 'true' and forceCheck is False: + if ((window('plex_pathverified') == 'true' and forceCheck is False) or + omitCheck is True): return path # exist() needs a / or \ at the end to work for directories diff --git a/resources/lib/music.py b/resources/lib/music.py index 3374fa47..9ed2cb7b 100644 --- a/resources/lib/music.py +++ b/resources/lib/music.py @@ -64,7 +64,7 @@ def set_excludefromscan_music_folders(): if location.tag == 'Location': path = api.validatePlayurl(location.attrib['path'], typus=v.PLEX_TYPE_ARTIST, - forceCheck=True) + omitCheck=True) path = tryEncode(path) paths.append(__turn_to_regex(path)) # Get existing advancedsettings