feat(playlists): playlists list their cover albums, and system mixes say what they hold
release / go (push) Successful in 2m2s
release / web (push) Successful in 1m26s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 4m10s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m48s
release / go (push) Successful in 2m2s
release / web (push) Successful in 1m26s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 4m10s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 2m48s
Each playlist on the wire (list and get) carries cover_album_ids: up to six distinct albums with art, in the order they first appear. A shelf of playlist tiles takes each tile's first album that no tile before it shows, so no cover repeats along the shelf. System mixes are stored with a one-line description of what they are built from, written in one place so the web and Android apps show the same words. Songs like and genre mixes have none; their names say it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -122,3 +122,22 @@ LIMIT $2;
|
||||
-- Batched lookup used by /api/library/sync to hydrate upsert payloads
|
||||
--. Mirror of GetArtistsByIDs.
|
||||
SELECT * FROM playlists WHERE id = ANY($1::uuid[]);
|
||||
|
||||
-- name: ListPlaylistCoverAlbums :many
|
||||
-- The albums a playlist's tiles can show: up to six distinct albums with
|
||||
-- cover art per playlist, in the order they first appear in its tracks.
|
||||
-- More than one per playlist, so a shelf of tiles can give each one a
|
||||
-- cover no other tile on the shelf is already showing.
|
||||
SELECT s.playlist_id,
|
||||
(array_agg(s.album_id ORDER BY s.first_position))[1:6]::uuid[] AS album_ids
|
||||
FROM (
|
||||
SELECT pt.playlist_id, t.album_id, MIN(pt.position) AS first_position
|
||||
FROM playlist_tracks pt
|
||||
JOIN tracks t ON t.id = pt.track_id
|
||||
JOIN albums a ON a.id = t.album_id
|
||||
WHERE pt.playlist_id = ANY(sqlc.arg(playlist_ids)::uuid[])
|
||||
AND a.cover_art_path IS NOT NULL
|
||||
AND a.cover_art_path <> ''
|
||||
GROUP BY pt.playlist_id, t.album_id
|
||||
) s
|
||||
GROUP BY s.playlist_id;
|
||||
|
||||
@@ -257,7 +257,7 @@ SELECT id, user_id, name, description, is_public, kind, system_variant,
|
||||
INSERT INTO playlists (
|
||||
user_id, name, description, is_public,
|
||||
kind, system_variant, seed_artist_id, cover_path
|
||||
) VALUES ($1, $2, '', false, 'system', $3, $4, $5)
|
||||
) VALUES ($1, $2, sqlc.arg(description), false, 'system', $3, $4, $5)
|
||||
RETURNING *;
|
||||
|
||||
-- name: GetSystemPlaylistByVariantForUser :one
|
||||
|
||||
Reference in New Issue
Block a user