diff options
| author | salmon <salmonik@tuta.io> | 2026-08-12 02:17:19 +0200 |
|---|---|---|
| committer | salmon <salmonik@tuta.io> | 2026-08-12 02:17:19 +0200 |
| commit | 6f09ab1f647eea41a33643e16320b57eaf40e63c (patch) | |
| tree | 00ac907e48974bd1e04f15b47319ede12294fd4f | |
| parent | queue logic fixes (diff) | |
| download | rsplayer-6f09ab1f647eea41a33643e16320b57eaf40e63c.tar.gz rsplayer-6f09ab1f647eea41a33643e16320b57eaf40e63c.zip | |
delete unused path for queue
| -rw-r--r-- | completions/_rsp | 2 | ||||
| -rw-r--r-- | src/cli.rs | 22 |
2 files changed, 6 insertions, 18 deletions
diff --git a/completions/_rsp b/completions/_rsp index ade1850..d2db44e 100644 --- a/completions/_rsp +++ b/completions/_rsp | |||
| @@ -3,7 +3,7 @@ functions[_rsp_clap]=$functions[_rsp] | |||
| 3 | 3 | ||
| 4 | _rsp() { | 4 | _rsp() { |
| 5 | case $words[2] in | 5 | case $words[2] in |
| 6 | play|queue) | 6 | play) |
| 7 | if (( CURRENT > 2 )); then | 7 | if (( CURRENT > 2 )); then |
| 8 | local cur="${words[$CURRENT]}" | 8 | local cur="${words[$CURRENT]}" |
| 9 | if [[ "$words[2]" == "play" && "$cur" == -* ]]; then | 9 | if [[ "$words[2]" == "play" && "$cur" == -* ]]; then |
| @@ -64,13 +64,8 @@ pub enum Commands { | |||
| 64 | #[arg(value_name = "MODE")] | 64 | #[arg(value_name = "MODE")] |
| 65 | mode: Option<String>, | 65 | mode: Option<String>, |
| 66 | }, | 66 | }, |
| 67 | /// Queue management | 67 | /// Show the queue |
| 68 | Queue { | 68 | Queue, |
| 69 | #[arg(value_name = "POSITION")] | ||
| 70 | position: Option<String>, | ||
| 71 | #[arg(value_name = "QUERY")] | ||
| 72 | query: Option<String>, | ||
| 73 | }, | ||
| 74 | /// Show player status | 69 | /// Show player status |
| 75 | Status, | 70 | Status, |
| 76 | /// Scan music paths to populate database | 71 | /// Scan music paths to populate database |
| @@ -197,16 +192,9 @@ impl Cli { | |||
| 197 | crate::daemon::send_command("shuffle".to_string())?; | 192 | crate::daemon::send_command("shuffle".to_string())?; |
| 198 | } | 193 | } |
| 199 | } | 194 | } |
| 200 | Commands::Queue { position, query } => match (position, query) { | 195 | Commands::Queue => { |
| 201 | (None, None) => { | 196 | crate::daemon::send_command("queue".to_string())?; |
| 202 | crate::daemon::send_command("queue".to_string())?; | 197 | } |
| 203 | } | ||
| 204 | (pos, Some(q)) => { | ||
| 205 | let pos = pos.as_deref().unwrap_or("last"); | ||
| 206 | crate::daemon::send_command(format!("queue {} {}", pos, q))?; | ||
| 207 | } | ||
| 208 | _ => {} | ||
| 209 | }, | ||
| 210 | Commands::Status => { | 198 | Commands::Status => { |
| 211 | crate::daemon::send_command("status".to_string())?; | 199 | crate::daemon::send_command("status".to_string())?; |
| 212 | } | 200 | } |
