feat(jellyfin): queue series neighbor episodes in the mpv playlist (#338)

This commit is contained in:
sudacode authored and GitHub committed 2026-11-24 01:45:27 -08:00
1 parent 713cdb3ef8
commit 926e6b047e
45 files changed
+2295 -197

No files matched your search

+28
View File
@@ -27,6 +27,34 @@ function M.create(ctx)
state.skip_managed_subtitle_rearm_once = true
state.app_managed_playback_pending = true
end)
-- Playlist entries the app queued (Jellyfin neighbor episodes). mpv starts them on its own,
-- so start-file recognizes them by path instead of waiting for subminer-managed-subtitles-loading.
mp.register_script_message("subminer-managed-playlist-entries", function(...)
local paths = {}
for _, path in ipairs({ ... }) do
paths[path] = true
end
state.app_managed_playlist_paths = paths
-- Options belong to queued entries; drop those the app no longer queues.
for path in pairs(state.app_playlist_entry_options) do
if not paths[path] then
state.app_playlist_entry_options[path] = nil
end
end
end)
-- `<path> <name> <value> ...`: options for an entry the app loads with loadlist, where mpv
-- (before 0.42) cannot take both a playlist title and per-file options.
mp.register_script_message("subminer-playlist-entry-options", function(path, ...)
if type(path) ~= "string" or path == "" then
return
end
local args = { ... }
local options = {}
for index = 1, #args - 1, 2 do
options[#options + 1] = { args[index], args[index + 1] }
end
state.app_playlist_entry_options[path] = options
end)
mp.register_script_message("subminer-menu", function()
ui.show_menu()
end)