From 28c53dbfa0fa9cd812818371e24aaed08683be66 Mon Sep 17 00:00:00 2001 From: LaserEyess Date: Wed, 23 Jun 2021 13:14:56 -0400 Subject: TOOLS/lua/autoload: add ignore_hidden option In 8a7614a0fb0d4f1073057049933972bb1113c14c files that start with a '.' were blacklisted from autoload.lua. Since then 35e8710b86545849484f6544a16047792fa75bb2 was introduced and explicitly whitelisted file extensions. With this change, there is no longer a reason to blacklist all files starting with '.', because it is valid to have a file called '.hidden.mkv', and there is no chance of hidden files such as '.bashrc', '.DS_STORE', '.gitignore', etc. being autoloaded by mpv. This commit tries to keep the same behavior as before, which is to by default not load hidden files, but allows the user to optionally allow hidden files to be autoloaded. --- TOOLS/lua/autoload.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua index 7150abb95e..10c7fbdef0 100644 --- a/TOOLS/lua/autoload.lua +++ b/TOOLS/lua/autoload.lua @@ -16,6 +16,7 @@ disabled=no images=no videos=yes audio=yes +ignore_hidden=yes --]] @@ -29,7 +30,8 @@ o = { disabled = false, images = true, videos = true, - audio = true + audio = true, + ignore_hidden = true } options.read_options(o) @@ -155,7 +157,7 @@ function find_and_add_entries() return end table.filter(files, function (v, k) - if string.match(v, "^%.") then + if (o.ignore_hidden and string.match(v, "^%.")) then return false end local ext = get_extension(v) -- cgit v1.2.3