summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorLaserEyess <lasereyess@users.noreply.github.com>2021-06-23 13:14:56 -0400
committerDudemanguy <random342@airmail.cc>2021-06-24 13:13:53 +0000
commit28c53dbfa0fa9cd812818371e24aaed08683be66 (patch)
treedeea6a8355238b50de43e5d9eac1104fbe1655d3 /TOOLS
parent5e23e81485fa22b3c2a0ecaca639fc6afbd872d0 (diff)
downloadmpv-28c53dbfa0fa9cd812818371e24aaed08683be66.tar.bz2
mpv-28c53dbfa0fa9cd812818371e24aaed08683be66.tar.xz
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.
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/lua/autoload.lua6
1 files changed, 4 insertions, 2 deletions
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)