From 25c5b80add517284cdfc5bc84939f0e6cc2dd223 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 1 Jun 2026 01:55:18 -0400 Subject: [PATCH] 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. --- .../com/fabledsword/minstrel/library/data/LibraryMappers.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/library/data/LibraryMappers.kt b/android/app/src/main/java/com/fabledsword/minstrel/library/data/LibraryMappers.kt index a6cf3982..8df83a69 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/library/data/LibraryMappers.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/library/data/LibraryMappers.kt @@ -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