fix(android): populate streamUrl in CachedTrackEntity to domain mapper
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user