mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-16 22:40:53 +08:00
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:
committed by
Kacper Michajłow
parent
e9aac03ab8
commit
157cef43d3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user