From b144da63a890dfebf6fd4f1d7bfefa6dcac1f7aa Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Thu, 13 Aug 2015 02:28:30 +0100 Subject: 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. --- TOOLS/lua/autoload.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'TOOLS') 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") -- cgit v1.2.3