Fix silent resume after walking away: seek-in-place re-primes the sink

Rediagnosed (was thought Bluetooth-specific): on the Debian 13 machine,
resuming after the machine sat idle plays nothing even though decoding
runs (visualizer moves) — the OS suspends the audio sink and it comes
back dead until a seek re-primes it. Resuming after a pause of 30s+ now
does a seek-in-place before play(), automating the manual "rewind
slightly" workaround without losing the position. The volume re-apply
from the earlier fix stays (harmless, covers device swaps).

Also fold the new backlog items into the TASKS.md board.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 15:56:11 -04:00
parent b69a25fa51
commit d46374967d
3 changed files with 58 additions and 6 deletions

View File

@ -252,6 +252,23 @@ class TestVolumeReapply:
assert applied == [True]
player._media.play.assert_called_once()
def test_long_pause_resume_seeks_in_place(self, qapp, tmp_path,
monkeypatch):
import time as time_module
player = _mock_player(qapp, tmp_path)
player._current_track = Track(track_id=1, name="A")
monkeypatch.setattr(player, "is_playing", lambda: False)
# Short pause: no nudge.
player._paused_at = time_module.monotonic() - 5
player.toggle_play()
player._media.setPosition.assert_not_called()
# Walk-away pause: seek-in-place re-primes the suspended sink.
player._media.position.return_value = 12345
player._paused_at = time_module.monotonic() - 600
player.toggle_play()
player._media.setPosition.assert_called_once_with(12345)
assert player._paused_at is None
# ---- Task B: search bar lives in the header strip ----