summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authordyphire <qimoge@gmail.com>2023-09-14 20:11:59 +0800
committerDudemanguy <random342@airmail.cc>2023-09-14 13:40:19 +0000
commit24cedfec8b333cc5693aa95a5739e0a48f6f2b36 (patch)
treea96712afb0f53bb78c24a57e98a760ce438e5d13 /TOOLS
parentdf3a0fa9791e6f65226ea5dccc9ca410095b05c0 (diff)
downloadmpv-24cedfec8b333cc5693aa95a5739e0a48f6f2b36.tar.bz2
mpv-24cedfec8b333cc5693aa95a5739e0a48f6f2b36.tar.xz
TOOLS/lua/autoload: change EXTENSIONS_TARGET to a local variable
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/lua/autoload.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua
index bd8069ebec..5737f1b634 100644
--- a/TOOLS/lua/autoload.lua
+++ b/TOOLS/lua/autoload.lua
@@ -166,7 +166,7 @@ local autoloaded = nil
local added_entries = {}
local autoloaded_dir = nil
-function scan_dir(path, current_file, dir_mode, separator, dir_depth, total_files)
+function scan_dir(path, current_file, dir_mode, separator, dir_depth, total_files, extensions)
if dir_depth == MAXDIRSTACK then
return
end
@@ -184,7 +184,7 @@ function scan_dir(path, current_file, dir_mode, separator, dir_depth, total_file
if ext == nil then
return false
end
- return EXTENSIONS_TARGET[string.lower(ext)]
+ return extensions[string.lower(ext)]
end)
table.filter(dirs, function(d)
return not ((o.ignore_hidden and string.match(d, "^%.")))
@@ -237,6 +237,7 @@ function find_and_add_entries()
end
end
+ local EXTENSIONS_TARGET = {}
if o.same_type then
if EXTENSIONS_VIDEO[string.lower(this_ext)] ~= nil then
EXTENSIONS_TARGET = EXTENSIONS_VIDEO
@@ -258,7 +259,7 @@ function find_and_add_entries()
do
local dir_mode = o.directory_mode or mp.get_property("directory-mode", "lazy")
local separator = mp.get_property_native("platform") == "windows" and "\\" or "/"
- scan_dir(autoloaded_dir, path, dir_mode, separator, 0, files)
+ scan_dir(autoloaded_dir, path, dir_mode, separator, 0, files, EXTENSIONS_TARGET)
end
if next(files) == nil then