feat: queue videos in running player

This commit is contained in:
2026-10-22 16:02:39 +02:00
parent b12bba9125
commit 585907f876
10 changed files with 193 additions and 73 deletions
+9 -2
View File
@@ -929,6 +929,7 @@ impl PlayerLaunch {
videos: &[Video],
player: &OsStr,
state: &mut crate::video_state::State,
enqueue: bool,
) -> io::Result<Self> {
if videos.is_empty() {
return Err(io::Error::new(
@@ -937,8 +938,14 @@ impl PlayerLaunch {
));
}
let mut command = isolated_command(player);
command.arg("--new-instance");
if let [video] = videos {
command.arg(if enqueue {
"--enqueue"
} else {
"--new-instance"
});
if let [video] = videos
&& !enqueue
{
let url = video_url(&video.id)?;
let report = state.progress_file(video)?;
crate::video_state::register_identity(&report, &video.id)?;