aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cli.rs15
1 files changed, 13 insertions, 2 deletions
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 {
35 /// Add to queue after current track (don't skip) 35 /// Add to queue after current track (don't skip)
36 #[arg(short = 'n', long = "next")] 36 #[arg(short = 'n', long = "next")]
37 next: bool, 37 next: bool,
38 /// Queue rest of album after this track (requires a track query)
39 #[arg(short = 'a', long = "album")]
40 album: bool,
38 #[arg(value_name = "QUERY")] 41 #[arg(value_name = "QUERY")]
39 query: Option<String>, 42 query: Option<String>,
40 }, 43 },
@@ -129,7 +132,11 @@ impl Cli {
129 crate::daemon::restart_daemon()?; 132 crate::daemon::restart_daemon()?;
130 } 133 }
131 Commands::Play { 134 Commands::Play {
132 now, next, query, .. 135 now,
136 next,
137 album,
138 query,
139 ..
133 } => { 140 } => {
134 if let Some(q) = query { 141 if let Some(q) = query {
135 let pos = if *now { 142 let pos = if *now {
@@ -139,7 +146,11 @@ impl Cli {
139 } else { 146 } else {
140 "last" 147 "last"
141 }; 148 };
142 crate::daemon::send_command(format!("play {} {}", pos, q))?; 149 if *album {
150 crate::daemon::send_command(format!("play-album {} {}", pos, q))?;
151 } else {
152 crate::daemon::send_command(format!("play {} {}", pos, q))?;
153 }
143 } else { 154 } else {
144 crate::daemon::send_command("play last".to_string())?; 155 crate::daemon::send_command("play last".to_string())?;
145 } 156 }