From 09c78a14cb7dc83c7711b6e58025d43272e9eaf7 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 27 May 2026 20:26:56 +0200 Subject: play [track] [-a/--album] option if supplied when a track is played, the rest of the album will be queued after the track --- src/cli.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 05cd61f..f5fdd2c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -35,6 +35,9 @@ pub enum Commands { /// Add to queue after current track (don't skip) #[arg(short = 'n', long = "next")] next: bool, + /// Queue rest of album after this track (requires a track query) + #[arg(short = 'a', long = "album")] + album: bool, #[arg(value_name = "QUERY")] query: Option, }, @@ -129,7 +132,11 @@ impl Cli { crate::daemon::restart_daemon()?; } Commands::Play { - now, next, query, .. + now, + next, + album, + query, + .. } => { if let Some(q) = query { let pos = if *now { @@ -139,7 +146,11 @@ impl Cli { } else { "last" }; - crate::daemon::send_command(format!("play {} {}", pos, q))?; + if *album { + crate::daemon::send_command(format!("play-album {} {}", pos, q))?; + } else { + crate::daemon::send_command(format!("play {} {}", pos, q))?; + } } else { crate::daemon::send_command("play last".to_string())?; } -- cgit v1.2.3