diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-11 16:25:49 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-11 16:25:49 +0200 |
| commit | 455ec54613230f4004a24f8d2798fb0084e00cb4 (patch) | |
| tree | 5ffb7606a11ebf33ea940f068ed046bfda0f0c54 /src/cli.rs | |
| parent | Fix shuffle to not shuffle current track - only shuffle tracks after current ... (diff) | |
| download | rsplayer-455ec54613230f4004a24f8d2798fb0084e00cb4.tar.gz rsplayer-455ec54613230f4004a24f8d2798fb0084e00cb4.zip | |
Add display_format config, fix restart command, clean up config code
- Add display_format option with get/set/list/unset for customizing track display
- Add Track::format() supporting $ARTIST, $ALBUM, $TRACK variables
- Update queue, status, notifications to use display_format
- Fix restart command using wrong subcommand 'start' -> 'start-daemon'
- Remove socket_path from config (now computed at runtime from XDG_RUNTIME_DIR)
- Consolidate duplicate save() and save_all() into single save()
- Fix redundant .clone().clone() in config.rs
- Add todo item for caching config in daemon hot paths
Diffstat (limited to '')
| -rw-r--r-- | src/cli.rs | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -14,9 +14,9 @@ pub struct Cli { | |||
| 14 | #[derive(Subcommand)] | 14 | #[derive(Subcommand)] |
| 15 | pub enum Commands { | 15 | pub enum Commands { |
| 16 | /// Start the daemon | 16 | /// Start the daemon |
| 17 | Start, | 17 | StartDaemon, |
| 18 | /// Stop the daemon | 18 | /// Stop the daemon |
| 19 | Stop, | 19 | StopDaemon, |
| 20 | /// Restart the daemon (kill existing and start new) | 20 | /// Restart the daemon (kill existing and start new) |
| 21 | Restart, | 21 | Restart, |
| 22 | /// Play a track, album, or artist | 22 | /// Play a track, album, or artist |
| @@ -37,7 +37,7 @@ pub enum Commands { | |||
| 37 | /// Toggle play/pause | 37 | /// Toggle play/pause |
| 38 | Toggle, | 38 | Toggle, |
| 39 | /// Stop playback | 39 | /// Stop playback |
| 40 | StopPlayback, | 40 | Stop, |
| 41 | /// Skip to next track | 41 | /// Skip to next track |
| 42 | Next, | 42 | Next, |
| 43 | /// Skip to previous track | 43 | /// Skip to previous track |
| @@ -101,10 +101,10 @@ pub enum SettingsCommands { | |||
| 101 | impl Cli { | 101 | impl Cli { |
| 102 | pub fn run(&self) -> Result<(), Box<dyn std::error::Error>> { | 102 | pub fn run(&self) -> Result<(), Box<dyn std::error::Error>> { |
| 103 | match &self.command { | 103 | match &self.command { |
| 104 | Commands::Start => { | 104 | Commands::StartDaemon => { |
| 105 | crate::daemon::start_daemon()?; | 105 | crate::daemon::start_daemon()?; |
| 106 | } | 106 | } |
| 107 | Commands::Stop => { | 107 | Commands::StopDaemon => { |
| 108 | crate::daemon::stop_daemon()?; | 108 | crate::daemon::stop_daemon()?; |
| 109 | } | 109 | } |
| 110 | Commands::Restart => { | 110 | Commands::Restart => { |
| @@ -135,7 +135,7 @@ impl Cli { | |||
| 135 | Commands::Toggle => { | 135 | Commands::Toggle => { |
| 136 | crate::daemon::send_command("toggle".to_string())?; | 136 | crate::daemon::send_command("toggle".to_string())?; |
| 137 | } | 137 | } |
| 138 | Commands::StopPlayback => { | 138 | Commands::Stop => { |
| 139 | crate::daemon::send_command("stop".to_string())?; | 139 | crate::daemon::send_command("stop".to_string())?; |
| 140 | } | 140 | } |
| 141 | Commands::Next => { | 141 | Commands::Next => { |
