mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 23:02:37 +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
|
||||
return
|
||||
end
|
||||
local isplaylist = mp.get_property("playlist-count")
|
||||
if #isplaylist > 1 then
|
||||
local pl_count = mp.get_property_number("playlist-count", 1)
|
||||
if (pl_count > 1 and autoload == nil) or
|
||||
(pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then
|
||||
return
|
||||
else
|
||||
autoload = true
|
||||
end
|
||||
|
||||
local files = mputils.readdir(dir, "files")
|
||||
|
Loading…
Reference in New Issue
Block a user