diff options
Diffstat (limited to '')
| -rw-r--r-- | src/cli.rs | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -105,6 +105,8 @@ pub enum SettingsCommands { | |||
| 105 | #[arg(value_name = "KEY")] | 105 | #[arg(value_name = "KEY")] |
| 106 | key: String, | 106 | key: String, |
| 107 | }, | 107 | }, |
| 108 | /// Reload config from disk (re-reads config file, re-validates scrobbling tokens) | ||
| 109 | Reload, | ||
| 108 | } | 110 | } |
| 109 | 111 | ||
| 110 | impl Cli { | 112 | impl Cli { |
| @@ -199,6 +201,9 @@ impl Cli { | |||
| 199 | SettingsCommands::Set { key, value } => { | 201 | SettingsCommands::Set { key, value } => { |
| 200 | config.set(key, value)?; | 202 | config.set(key, value)?; |
| 201 | config.save()?; | 203 | config.save()?; |
| 204 | if key == "listenbrainz_token" { | ||
| 205 | let _ = crate::daemon::send_command("validate".to_string()); | ||
| 206 | } | ||
| 202 | } | 207 | } |
| 203 | SettingsCommands::List => { | 208 | SettingsCommands::List => { |
| 204 | config.list(); | 209 | config.list(); |
| @@ -207,6 +212,9 @@ impl Cli { | |||
| 207 | config.unset(key)?; | 212 | config.unset(key)?; |
| 208 | config.save()?; | 213 | config.save()?; |
| 209 | } | 214 | } |
| 215 | SettingsCommands::Reload => { | ||
| 216 | let _ = crate::daemon::send_command("reload".to_string()); | ||
| 217 | } | ||
| 210 | } | 218 | } |
| 211 | } | 219 | } |
| 212 | Commands::Completions { shell } => { | 220 | Commands::Completions { shell } => { |
