Skip to content

feat: show LRCLIB lyrics in Now Playing view with caching#25

Open
pythoninthegrass wants to merge 1 commit intomainfrom
begin-backlog-task-296
Open

feat: show LRCLIB lyrics in Now Playing view with caching#25
pythoninthegrass wants to merge 1 commit intomainfrom
begin-backlog-task-296

Conversation

@pythoninthegrass
Copy link
Collaborator

Add lyrics fetching from lrclib.net with per-track SQLite caching. When lyrics are available, the Now Playing left panel switches to a compact album art header with a scrollable lyrics panel below. When no lyrics are found the view remains unchanged.

Backend: db/lyrics.rs (cache CRUD), lyrics.rs (LRCLIB HTTP client with 10s timeout, mt-desktop User-Agent), commands/lyrics.rs (lyrics_get cache-first async command, lyrics_clear_cache). Negative results are cached to avoid repeated failed lookups.

Frontend: api/lyrics.js (Tauri command wrapper), now-playing-view.js (lyrics state with visibility-gated fetching, superseded-fetch guard), now-playing.html (conditional two-layout rendering).

Tests: 11 Rust tests (DB round-trip, LRCLIB response parsing), 12 Vitest tests (API invocation, visibility gating, track change, error handling). All 622 existing Rust + 331 Vitest tests pass.

Add lyrics fetching from lrclib.net with per-track SQLite caching.
When lyrics are available, the Now Playing left panel switches to a
compact album art header with a scrollable lyrics panel below. When
no lyrics are found the view remains unchanged.

Backend: db/lyrics.rs (cache CRUD), lyrics.rs (LRCLIB HTTP client with
10s timeout, mt-desktop User-Agent), commands/lyrics.rs (lyrics_get
cache-first async command, lyrics_clear_cache). Negative results are
cached to avoid repeated failed lookups.

Frontend: api/lyrics.js (Tauri command wrapper), now-playing-view.js
(lyrics state with visibility-gated fetching, superseded-fetch guard),
now-playing.html (conditional two-layout rendering).

Tests: 11 Rust tests (DB round-trip, LRCLIB response parsing), 12
Vitest tests (API invocation, visibility gating, track change, error
handling). All 622 existing Rust + 331 Vitest tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant