diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2015-08-13 02:28:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-08-20 22:05:03 +0200 |
commit | b144da63a890dfebf6fd4f1d7bfefa6dcac1f7aa (patch) | |
tree | 016de875f9582400e41cdb14491790313436b86a /TOOLS/lua | |
parent | 9cd929bf79f3426d0b7fd5954c0c2b6d94c9a45f (diff) |
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.
Diffstat (limited to 'TOOLS/lua')
-rw-r--r-- | TOOLS/lua/autoload.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua index 454f7fce9b..2737418dcd 100644 --- a/TOOLS/lua/autoload.lua +++ b/TOOLS/lua/autoload.lua @@ -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") |