0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

autoload.lua: fix options update

The extensions list needs to be cleared in this case. Also, add the
missing split_patterns().
This commit is contained in:
Kacper Michajłow 2024-06-03 20:28:50 +02:00
parent fa89082f2e
commit 7d4719704e

View File

@ -74,10 +74,10 @@ local EXTENSIONS_IMAGES_DEFAULT = Set {
'svg', 'tga', 'tif', 'tiff', 'webp'
}
local EXTENSIONS = {}
local EXTENSIONS_VIDEO = {}
local EXTENSIONS_AUDIO = {}
local EXTENSIONS_IMAGES = {}
local EXTENSIONS
local EXTENSIONS_VIDEO
local EXTENSIONS_AUDIO
local EXTENSIONS_IMAGES
local function SetUnion (a,b)
for k in pairs(b) do a[k] = true end
@ -137,6 +137,10 @@ local function split_patterns()
end
local function create_extensions()
EXTENSIONS = {}
EXTENSIONS_VIDEO = {}
EXTENSIONS_AUDIO = {}
EXTENSIONS_IMAGES = {}
if o.videos then
SetUnion(SetUnion(EXTENSIONS_VIDEO, EXTENSIONS_VIDEO_DEFAULT), o.additional_video_exts)
SetUnion(EXTENSIONS, EXTENSIONS_VIDEO)
@ -169,6 +173,9 @@ options.read_options(o, nil, function(list)
if list.directory_mode then
validate_directory_mode()
end
if list.ignore_patterns then
split_patterns()
end
end)
split_option_exts(true, true, true)