fix(playlists): each daily mix keeps its id across rebuilds (#8081)
The nightly rebuild deleted every system playlist and inserted new rows, so each mix got a new id every day. A Subsonic app caches, pins, downloads and syncs a playlist by id, and saw its mixes deleted and recreated daily: a stored mix answered "not found" and an offline download was orphaned. The rebuild now refills yesterday's row for the same mix in place (keyed by kind, plus the seed artist for "Songs like" and the name for a genre mix), inserts only mixes that are new, and deletes the ones today's build didn't make, along with their collage files. The rollups move updated_at, which is the "changed" time Subsonic apps use to see a mix was refreshed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ func buildDiscoverCandidates(ctx context.Context, q *dbq.Queries, logger *slog.L
|
||||
pools.random[:allocations[3]],
|
||||
)
|
||||
|
||||
// Convert to rankedCandidate (the type insertSystemPlaylist accepts).
|
||||
// Convert to rankedCandidate (the type materializeSystemPlaylist accepts).
|
||||
// Score is unused for Discover — the daily-deterministic md5 ordering
|
||||
// already gave us the ranking.
|
||||
ranked := make([]rankedCandidate, 0, len(out))
|
||||
|
||||
Reference in New Issue
Block a user