mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 15:22:09 +00:00
TOOLS/lua/autoload: fix adding more files at end of auto-playlist
Fixes regression in dfd8a5f
that made autoload not add more files
at the end of the current playlist if playlist was made by the
script.
This still prevents loading the script if more than one (media or
playlist) file was manually added.
This commit is contained in:
parent
9cd929bf79
commit
b144da63a8
@ -47,9 +47,12 @@ function find_and_add_entries()
|
|||||||
if #dir == 0 then
|
if #dir == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local isplaylist = mp.get_property("playlist-count")
|
local pl_count = mp.get_property_number("playlist-count", 1)
|
||||||
if #isplaylist > 1 then
|
if (pl_count > 1 and autoload == nil) or
|
||||||
|
(pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then
|
||||||
return
|
return
|
||||||
|
else
|
||||||
|
autoload = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local files = mputils.readdir(dir, "files")
|
local files = mputils.readdir(dir, "files")
|
||||||
|
Loading…
Reference in New Issue
Block a user