autoload.lua: exit early when path is a directory

Before this change, autoload would split a directory path into two,
using the parent directory as the autoload directory. This lead to the
addition of unexpected files to the playlist.

Now, the effective behavior when a directory is given falls back to the
configured mpv directory-mode.
This commit is contained in:
Fabian Mildner
2026-05-16 16:05:59 +02:00
committed by Kacper Michajłow
parent e9aac03ab8
commit 157cef43d3
+5
View File
@@ -297,6 +297,11 @@ local function find_and_add_entries()
end
local path = mp.get_property("path", "")
if utils.readdir(path) then
msg.debug("stopping: current path is a directory")
return
end
local dir, filename = utils.split_path(path)
msg.trace(("dir: %s, filename: %s"):format(dir, filename))
if o.disabled then