fix(android): populate streamUrl in CachedTrackEntity to domain mapper
android / Build + lint + test (push) Successful in 3m30s
android / Build signed release APK (push) Has been skipped

CachedTrackEntity.toDomain() was emitting TrackRef.streamUrl="" (the
default). Tracks routed through MetadataProvider (the Home cache
hydration path used by Most Played) inherited the empty string;
player.setQueue() then got a queue of unplayable tracks.

The server's stream_url is deterministic per track id
(internal/api/convert.go:75 streamURL builder), so the cache mapper
can reconstruct it from the row's id without storing it in Room.
TrackWire.toDomain() continues to use the wire-provided value
(identical content).

Operator reported "tap to play wiring in Most Played queues content
that can't play" on 2026-06-01. The Most Played multi-row layout
itself isn't the cause - the same gap affected the single-row
layout - but the denser display made the dead taps more obvious.
This commit is contained in:
2026-06-01 01:55:18 -04:00
parent 1fdc5b0a1f
commit 25c5b80add
@@ -97,6 +97,12 @@ fun CachedTrackEntity.toDomain(
trackNumber = trackNumber,
discNumber = discNumber,
durationSec = durationMs.millisToSeconds(),
// Deterministic from track id; matches the server's stream_url
// (internal/api/convert.go:75 streamURL builder). Cached rows
// didn't carry streamUrl before, which left MetadataProvider-
// sourced tracks (Home Most Played, etc.) unplayable when their
// queue was set on tap.
streamUrl = "/api/tracks/$id/stream",
)
// Wire to Domain — for fresh server responses that bypass the cache