diff --git a/couchpotato/core/helpers/variable.py b/couchpotato/core/helpers/variable.py index f98adaa2..b3de6833 100644 --- a/couchpotato/core/helpers/variable.py +++ b/couchpotato/core/helpers/variable.py @@ -294,8 +294,8 @@ def dictIsSubset(a, b): # Returns True if sub_folder is the same as or inside base_folder def isSubFolder(sub_folder, base_folder): if base_folder and sub_folder: - base = sp(os.path.realpath(base_folder)) - subfolder = sp(os.path.realpath(sub_folder)) + base = sp(os.path.realpath(base_folder)) + os.path.sep + subfolder = sp(os.path.realpath(sub_folder)) + os.path.sep return os.path.commonprefix([subfolder, base]) == base return False diff --git a/couchpotato/core/plugins/file.py b/couchpotato/core/plugins/file.py index 2145ffeb..80c073fc 100644 --- a/couchpotato/core/plugins/file.py +++ b/couchpotato/core/plugins/file.py @@ -82,6 +82,7 @@ class FileManager(Plugin): def doSubfolderTest(self): tests = { + ('/test/subfolder', '/test/sub'): False, ('/test/sub/folder', '/test/sub'): True, ('/test/sub/folder', '/test/sub2'): False, ('/sub/fold', '/test/sub/fold'): False,