From 04add15691578316ff3da5b5a07d05b314488370 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 16 May 2026 11:43:32 +0200 Subject: Add scrobbling support (Last.fm + ListenBrainz) and rsp settings reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Full Last.fm API implementation with MD5 signing (track.updateNowPlaying, track.scrobble) - Full ListenBrainz API implementation (/1/submit-listens for playing_now and single) - ScrobbleState in daemon tracking track, start time, and unix timestamp per play - Scrobble threshold: ≥30s play AND (≥half duration OR ≥4 min) - Duration extraction from symphonia codec params into AudioMetadata and Track - Token validation at daemon startup and on config change - ListenBrainz token valid (user: Salmonium) command to re-read config from disk (avoids token in shell history) - Desktop notifications for token validation results - Empty-credential filtering (empty string = no-op) --- src/cli.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 7d56de6..f9a3c6f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -105,6 +105,8 @@ pub enum SettingsCommands { #[arg(value_name = "KEY")] key: String, }, + /// Reload config from disk (re-reads config file, re-validates scrobbling tokens) + Reload, } impl Cli { @@ -199,6 +201,9 @@ impl Cli { SettingsCommands::Set { key, value } => { config.set(key, value)?; config.save()?; + if key == "listenbrainz_token" { + let _ = crate::daemon::send_command("validate".to_string()); + } } SettingsCommands::List => { config.list(); @@ -207,6 +212,9 @@ impl Cli { config.unset(key)?; config.save()?; } + SettingsCommands::Reload => { + let _ = crate::daemon::send_command("reload".to_string()); + } } } Commands::Completions { shell } => { -- cgit v1.2.3