From d2e3fd9383cad6ceecf3553ccf8a7c267cd04aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 6 Mar 2025 09:10:29 +0100 Subject: [PATCH] auto_profiles.lua: make profiles apply with higher priority This increases the priority from 50 (which is neutral) to ensure that profiles are applied before other scripts. In general, applying profiles before other scripts makes sense. This was already the case for external scripts with default priority because they would load after auto_profiles. This commit primarily fixes ytdl_hook.lua to respond to profile changes. In most cases, profile conditions are triggered by external conditions, not the output from the ytdl hook, so this is fine. I acknowledge that this will change the order if a script previously had a priority lower than 50. However, injecting itself before profiles are evaluated is a very obscure use case, if there is even a valid one. --- DOCS/interface-changes/auto-profiles-prio.txt | 1 + player/lua/auto_profiles.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 DOCS/interface-changes/auto-profiles-prio.txt diff --git a/DOCS/interface-changes/auto-profiles-prio.txt b/DOCS/interface-changes/auto-profiles-prio.txt new file mode 100644 index 0000000000..20651eebb9 --- /dev/null +++ b/DOCS/interface-changes/auto-profiles-prio.txt @@ -0,0 +1 @@ +Change auto profiles hook priority from 50 to 5 diff --git a/player/lua/auto_profiles.lua b/player/lua/auto_profiles.lua index efc0b08290..ee770429bc 100644 --- a/player/lua/auto_profiles.lua +++ b/player/lua/auto_profiles.lua @@ -203,5 +203,5 @@ end) mp.register_idle(on_idle) for _, name in ipairs({"on_load", "on_preloaded", "on_before_start_file"}) do - mp.add_hook(name, 50, on_hook) + mp.add_hook(name, 5, on_hook) end