mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-23 04:46:08 -08:00
feat(jellyfin): queue series neighbor episodes in the mpv playlist
Jellyfin playback now keeps the episodes around the playing one in mpv's playlist, so mpv's playlist keys and end-of-file advance move through the series (across seasons) in the same mpv and app session. - Queue neighbors only after the first time-pos, so startup is not slowed. - Adopt queued entries on mpv's path change without a loadfile: report the previous item stopped, then start reporting, stats, and subtitles for the new one. Runs before the immersion sync so stats metadata is recorded first. - Tell the mpv plugin which playlist paths the app manages so start-file skips subtitle rearm and overlay auto-start for them. - Add jellyfin.episodePlaylist.enabled (default on) and maxEpisodes (default 5, clamped 2-25), a rolling window centered on the current episode, under Settings > Integrations > Jellyfin > Episode Playlist. - Add a fake-Jellyfin e2e scenario covering next/prev in one session.
This commit is contained in:
41 files changed
+1450
-149
No files matched your search
@@ -1042,6 +1042,65 @@ do
|
||||
)
|
||||
end
|
||||
|
||||
do
|
||||
local scenario = {
|
||||
process_list = "",
|
||||
option_overrides = {
|
||||
binary_path = binary_path,
|
||||
auto_start = "yes",
|
||||
auto_start_visible_overlay = "yes",
|
||||
auto_start_pause_until_ready = "yes",
|
||||
socket_path = "/tmp/subminer-socket",
|
||||
},
|
||||
input_ipc_server = "/tmp/subminer-socket",
|
||||
path = "https://jellyfin.example/Videos/ep1/stream",
|
||||
media_title = "Jellyfin Episode 1",
|
||||
files = {
|
||||
[binary_path] = true,
|
||||
},
|
||||
}
|
||||
local recorded, err = run_plugin_scenario(scenario)
|
||||
assert_true(recorded ~= nil, "plugin failed to load for managed playlist entry scenario: " .. tostring(err))
|
||||
recorded.script_messages["subminer-managed-playlist-entries"](
|
||||
"https://jellyfin.example/Videos/ep1/stream",
|
||||
"https://jellyfin.example/Videos/ep2/stream"
|
||||
)
|
||||
fire_event(recorded, "end-file", { reason = "eof" })
|
||||
scenario.path = "https://jellyfin.example/Videos/ep2/stream"
|
||||
scenario.media_title = "Jellyfin Episode 2"
|
||||
fire_event(recorded, "start-file")
|
||||
fire_event(recorded, "file-loaded")
|
||||
assert_true(
|
||||
not has_property_set(recorded.property_sets, "sid", "auto"),
|
||||
"an app-queued playlist entry should keep the app's subtitle selection"
|
||||
)
|
||||
assert_true(
|
||||
count_start_calls(recorded.async_calls) == 0,
|
||||
"an app-queued playlist entry should not auto-start the overlay"
|
||||
)
|
||||
assert_true(
|
||||
count_property_set(recorded.property_sets, "pause", true) == 0,
|
||||
"an app-queued playlist entry should not arm the plugin pause gate"
|
||||
)
|
||||
assert_true(
|
||||
not has_osd_message(recorded.osd, "SubMiner: Overlay loading |"),
|
||||
"an app-queued playlist entry should not show the overlay loading spinner"
|
||||
)
|
||||
fire_event(recorded, "end-file", { reason = "stop" })
|
||||
scenario.path = "/media/local-episode.mkv"
|
||||
scenario.media_title = "Local Episode"
|
||||
fire_event(recorded, "start-file")
|
||||
fire_event(recorded, "file-loaded")
|
||||
assert_true(
|
||||
count_property_set(recorded.property_sets, "sid", "auto") == 1,
|
||||
"a path the app did not queue should get the normal subtitle rearm"
|
||||
)
|
||||
assert_true(
|
||||
count_start_calls(recorded.async_calls) == 1,
|
||||
"a path the app did not queue should auto-start the overlay"
|
||||
)
|
||||
end
|
||||
|
||||
do
|
||||
local recorded, err = run_plugin_scenario({
|
||||
process_list = "",
|
||||
|
||||
Reference in new issue
Block a user