Skip to content

Commit

Permalink
Update load-dir.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
samhippo authored May 23, 2020
1 parent 5abd246 commit 074bcf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions load-dir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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, "%.([^.]+)$")
Expand All @@ -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)

0 comments on commit 074bcf3

Please sign in to comment.