Repository navigation
v0.3.2 — stop leaking the album-art cache, and verify the rating input
The album-art cache grew without bound, for ever
Every track change wrote ~/.cache/gapless/art-{n} for MPRIS clients to point at, and nothing ever deleted one. Worse, the sequence restarts at zero on every launch, so each run overwrote art-1, art-2… and permanently orphaned everything above its own high-water mark.
Measured on a real install before the fix: 283 orphaned cover files, at ~96 KB each on that library — tens of megabytes nothing would ever read again, growing for as long as the player runs.
The newest four are kept — more than one, because an MPRIS client fetches art asynchronously and may still be reading the previous track's file — and a launch sweeps whatever earlier runs left behind. Pruned by the sequence number parsed from the name, not lexically: art-9 sorts after art-10 as a string, which would delete the newest cover and keep nine stale ones.
Correction. The first version of these notes said 682 MB across 285 files. The count was right, the size was not:
~/.cache/gaplessalso holds this project's own AppImage build scratch (~500 MB), anddu -shon the directory counted it as leaked album art. The leak and the fix are unchanged; the number was published before it was checked against what those files actually were.
A cued track had no position
GET /api/status reported position_secs: 0.0 for a track restored from the last session. It has a position — it is where the resume will start — but nothing was loaded yet, so the pipeline answered zero. A caller was told the track was at the beginning when it was two minutes in.
New: scripts/verify-input.sh
The two rating paths nothing else could reach — the number-key accelerators and the right-click menu on a list row — now have 9 checks against the real window with real XTEST input.
Two things made that hard, both worth knowing if you automate a GTK4 app: GTK4 ignores synthetic key events (xdotool key --window uses XSendEvent and does nothing, silently), so the window must genuinely hold focus; and a window manager can refuse focus to a window that just appeared. The script maps, raises, activates and focuses, then verifies with getactivewindow before sending anything, and fails rather than skipping if focus is refused — a check that quietly does nothing is worse than no check.
cargo test 33/33 · verify.sh 6/6 · verify-resume.sh 4/4 · verify-mpris-modes.sh 4/4 · verify-api.sh 44/44 · verify-input.sh 9/9