From 157cef43d30ccb503867f3fced5aeffba8c28dc9 Mon Sep 17 00:00:00 2001 From: Fabian Mildner Date: Sat, 16 May 2026 16:05:59 +0200 Subject: [PATCH] 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. --- TOOLS/lua/autoload.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua index ffe56e6e02..6476c1d6bb 100644 --- a/TOOLS/lua/autoload.lua +++ b/TOOLS/lua/autoload.lua @@ -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