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.
Showing the changes to TOOLS/lua/autoload.lua (1 of 1 file). Show all
Unified · Split
| @@ -16,6 +16,7 @@ disabled=no · 15 unmodified lines | ||
| 16 | 16 | images=no |
| 17 | 17 | videos=yes |
| 18 | 18 | audio=yes |
| 19 | +ignore_hidden=yes | |
| 19 | 20 | |
| 20 | 21 | --]] |
| 21 | 22 | |
| @@ -29,7 +30,8 @@ o = { · 7 unmodified lines | ||
| 29 | 30 | disabled = false, |
| 30 | 31 | images = true, |
| 31 | 32 | videos = true, |
| 32 | − audio = true | |
| 33 | + audio = true, | |
| 34 | + ignore_hidden = true | |
| 33 | 35 | } |
| 34 | 36 | options.read_options(o) |
| 35 | 37 | |
| @@ -155,7 +157,7 @@ function find_and_add_entries() · 119 unmodified lines | ||
| 155 | 157 | return |
| 156 | 158 | end |
| 157 | 159 | table.filter(files, function (v, k) |
| 158 | − if string.match(v, "^%.") then | |
| 160 | + if (o.ignore_hidden and string.match(v, "^%.")) then | |
| 159 | 161 | return false |
| 160 | 162 | end |
| 161 | 163 | local ext = get_extension(v) |