v0.1.4: playback-control provenance log

LinTunes has spontaneously resumed playback for ~4s (then paused) four
times while trav was away — suspected phantom media-key events from the
Audioengine USB DAC's HID 'keyboard', but the pathway (MPRIS vs the
focused-window key filter) is unproven. Every control path now drops a
timestamped line in ~/.cache/lintunes/control-events.log: MPRIS Player
methods, the media-key eventFilter (with source input device where the
compositor exposes it), and Player.toggle_play/pause with position. New
lintunes/eventlog.py, 1MB rotation, never raises; conftest autouse
fixture keeps tests off the real log file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 18:09:21 -04:00
parent a50c39fa43
commit 663d5e5a08
8 changed files with 210 additions and 1 deletions

View File

@ -8,6 +8,15 @@ import pytest
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
@pytest.fixture(autouse=True)
def _isolate_eventlog(tmp_path, monkeypatch):
"""Keep the control-provenance log out of the real ~/.cache during tests
(Player/MPRIS methods log unconditionally)."""
from lintunes import eventlog
monkeypatch.setattr(eventlog, "_log_path",
lambda: tmp_path / "control-events.log")
@pytest.fixture(scope="session")
def qapp():
"""A Qt application so QObject/QTimer and real widgets work in tests.