From 074bcf3157998d34a0ef955d322e5d675bcc37d6 Mon Sep 17 00:00:00 2001 From: samhippo <63636707+samhippo@users.noreply.github.com> Date: Sat, 23 May 2020 03:16:46 -0700 Subject: [PATCH] Update load-dir.lua --- load-dir.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/load-dir.lua b/load-dir.lua index d10ae54..8bf5ae6 100644 --- a/load-dir.lua +++ b/load-dir.lua @@ -26,6 +26,7 @@ local function main() local dir, f = utils.split_path(mp.get_property("path")) local ar = utils.readdir(dir,"files") + local c = 0 if(ar == nil) then return end for i, name in ipairs(ar) do local ext = string.match(name, "%.([^.]+)$") @@ -34,8 +35,10 @@ local function main() local filename = utils.join_path(dir, name) if(valid[ext] and isNew(filename)) then mp.commandv('loadfile',filename,'append') + c = c + 1 end end + mp.osd_message('Added '..c..' files') end mp.register_script_message("load-dir", main)