feat: queue videos in running player
This commit is contained in:
+9
-2
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user