summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TOOLS/lua/autoload.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua
index ebea903a18..049af868c0 100644
--- a/TOOLS/lua/autoload.lua
+++ b/TOOLS/lua/autoload.lua
@@ -26,6 +26,9 @@ function find_and_add_entries()
end
local files = mputils.readdir(dir, "files")
table.sort(files)
+ if dir == "." then
+ dir = ""
+ end
local pl = mp.get_property_native("playlist", {})
local pl_current = mp.get_property_number("playlist-pos", 0) + 1
-- Find the current pl entry (dir+"/"+filename) in the sorted dir list
@@ -47,20 +50,21 @@ function find_and_add_entries()
if file == nil or file[1] == "." then
break
end
+ local filepath = dir .. file
if pl_e then
-- If there's a playlist entry, and it's the same file, stop.
- if pl_e.filename == file then
+ if pl_e.filename == filepath then
break
end
end
if direction == -1 then
if pl_current == 1 then -- never add additional entries in the middle
mp.msg.info("Prepending " .. file)
- table.insert(append[-1], 1, file)
+ table.insert(append[-1], 1, filepath)
end
else
mp.msg.info("Adding " .. file)
- table.insert(append[1], file)
+ table.insert(append[1], filepath)
end
end
end