History

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.

LaserEyess committed 5 years ago

Commit 28c53db1 parent 5e23e811 file · +4 −2Browse files

Showing the changes to TOOLS/lua/autoload.lua (1 of 1 file). Show all

Unified · Split

TOOLS/lua/autoload.lua+4−2
@@ -16,6 +16,7 @@ disabled=no · 15 unmodified lines
1616 images=no
1717 videos=yes
1818 audio=yes
19+ignore_hidden=yes
1920
2021 --]]
2122
@@ -29,7 +30,8 @@ o = { · 7 unmodified lines
2930 disabled = false,
3031 images = true,
3132 videos = true,
32− audio = true
33+ audio = true,
34+ ignore_hidden = true
3335 }
3436 options.read_options(o)
3537
@@ -155,7 +157,7 @@ function find_and_add_entries() · 119 unmodified lines
155157 return
156158 end
157159 table.filter(files, function (v, k)
158− if string.match(v, "^%.") then
160+ if (o.ignore_hidden and string.match(v, "^%.")) then
159161 return false
160162 end
161163 local ext = get_extension(v)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t