From cadf8e333a6fac23e70b83d3dfb2ddfd10a5d108 Mon Sep 17 00:00:00 2001 From: Mettbrot Date: Mon, 19 May 2014 12:27:36 +0200 Subject: [PATCH 1/4] Add Setting for Recursive Scanning --- resources/language/english/strings.xml | 1 + resources/settings.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/resources/language/english/strings.xml b/resources/language/english/strings.xml index d5b38ce..49bfdd8 100644 --- a/resources/language/english/strings.xml +++ b/resources/language/english/strings.xml @@ -7,6 +7,7 @@ Log Missing To Blacklisted Words Debug Logging + Recursive Scanning Scanned : {0} Directories {1} Files Processed : {0} Folders, {1} Files, {2} Matches diff --git a/resources/settings.xml b/resources/settings.xml index ec22d55..c43c5f4 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -6,5 +6,6 @@ + From 53efb87099b499472c7abe348022c3e900f090ef Mon Sep 17 00:00:00 2001 From: Mettbrot Date: Mon, 19 May 2014 12:37:13 +0200 Subject: [PATCH 2/4] Check if RECURSIVE_SCANNING is activated --- default.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/default.py b/default.py index c989d9d..355c87c 100644 --- a/default.py +++ b/default.py @@ -17,6 +17,7 @@ DEBUG_LOGGING = False handle = int(sys.argv[1]) FILE_EXTENSIONS = [] +RECURSIVE_SCANNING = True # plugin modes MODE_SCAN_SOURCE = 10 @@ -198,7 +199,8 @@ def walk_Path(path, walked_files, progress): if progress.iscanceled(): return if file['filetype'] == "directory": - walk_Path(file["file"], walked_files, progress) + if RECURSIVE_SCANNING: + walk_Path(file["file"], walked_files, progress) elif file['filetype'] == "file": fileCount += 1 if file_has_extensions(file["file"], FILE_EXTENSIONS) and file_contains_forbiden(file["file"]) == False: @@ -525,6 +527,7 @@ def show_source_list(): log("Debug Logging : " + str(DEBUG_LOGGING)) FILE_EXTENSIONS = get_extensions(xbmcplugin.getSetting(handle, "custom_file_extensions")) BLACKLIST_STRINGS = get_blacklist(xbmcplugin.getSetting(handle, "blacklist")) +RECURSIVE_SCANNING = xbmcplugin.getSetting(handle, "recursive_scanning") == "true" # Depending on the mode do stuff if not sys.argv[2]: From 302a4ce3b417c56ae5ea466d0d848ccc41ba9f44 Mon Sep 17 00:00:00 2001 From: Mettbrot Date: Mon, 19 May 2014 12:27:36 +0200 Subject: [PATCH 3/4] Add Setting for Recursive Scanning --- resources/language/english/strings.xml | 1 + resources/settings.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/resources/language/english/strings.xml b/resources/language/english/strings.xml index 699ec6b..c31ca65 100644 --- a/resources/language/english/strings.xml +++ b/resources/language/english/strings.xml @@ -7,6 +7,7 @@ Log Missing To Blacklisted Words Debug Logging + Recursive Scanning Scanned : {0} Directories {1} Files Processed : {0} Folders, {1} Files, {2} Matches diff --git a/resources/settings.xml b/resources/settings.xml index 76fec41..c7ecad9 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -4,6 +4,7 @@ + From f385ee75d8331e39b023985a795c85c574384fd7 Mon Sep 17 00:00:00 2001 From: Mettbrot Date: Mon, 19 May 2014 12:37:13 +0200 Subject: [PATCH 4/4] Check if RECURSIVE_SCANNING is activated --- default.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/default.py b/default.py index 12c4b20..6de60f6 100644 --- a/default.py +++ b/default.py @@ -18,6 +18,7 @@ LOG_ENABLED = False handle = int(sys.argv[1]) +RECURSIVE_SCANNING = True # plugin modes MODE_SCAN_SOURCE = 10 @@ -183,7 +184,8 @@ def walk_Path(path, walked_files, progress): if progress.iscanceled(): return if file['filetype'] == "directory": - walk_Path(file["file"], walked_files, progress) + if RECURSIVE_SCANNING: + walk_Path(file["file"], walked_files, progress) elif file['filetype'] == "file": fileCount += 1 filename = file["file"] @@ -512,7 +514,7 @@ def show_source_list(): FILE_EXTENSIONS = xbmc.getSupportedMedia('video').decode('utf-8').split('|') BLACKLISTED_EXTENSIONS = xbmcplugin.getSetting(handle, "blacklisted_file_extensions").decode('utf-8').split('|') BLACKLIST_STRINGS = get_blacklist(xbmcplugin.getSetting(handle, "blacklist").decode('utf-8')) - +RECURSIVE_SCANNING = xbmcplugin.getSetting(handle, "recursive_scanning") == "true" # Depending on the mode do stuff if not sys.argv[2]: