A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz

fix(cli): stop MPD losing the current song / volume on a TUI volume change master

Changing volume in the TUI (or any mid-playback engine change) can make the native player's status() throw for a tick; status() caught it and returned null. External consumers — the MPD server — then read that single null as "stopped, no song": the poller bumped the `player` subsystem, idle clients (rmpc, ncmpcpp) re-fetched currentsong and got nothing, and the transient `state: stop` made them show an invalid volume. Both symptoms, one glitch. - player.status() now holds the last successful native status and returns it when a native call throws, so a transient hiccup no longer reads as stopped. Cleared on close(). Benefits every consumer (TUI, MPD, scrobbler). - Guard the MPD volume report to a valid 0..100 integer (mpdVolume()); a NaN/out-of-range value made clients discard the whole status. - Clamp applySettings volume to 0..1 so a bad persisted value can't leak out.


+31 -9
4 changed files