feat(*): add image grids for album and associated media displays

This commit is contained in:
Cory Dransfeldt 2025-05-24 17:19:30 -07:00
parent 9b4baad5fb
commit 36fbba761a
No known key found for this signature in database
53 changed files with 1179 additions and 764 deletions

View file

@ -5,7 +5,20 @@ SELECT
ol.artist_art,
ol.artist_url,
ARRAY_AGG(DISTINCT ol.genre_name) AS genres,
json_build_object('title', ol.artist_name, 'image', ol.artist_art, 'url', ol.artist_url, 'alt', CONCAT(COUNT(*), ' plays of ', ol.artist_name), 'subtext', CONCAT(COUNT(*), ' plays')) AS grid
json_build_object(
'title', ol.artist_name,
'image', ol.artist_art,
'url', ol.artist_url,
'alt', CONCAT(COUNT(*), ' plays of ', ol.artist_name),
'subtext', CONCAT(COUNT(*), ' plays')
) AS grid,
json_build_object(
'open_graph_image',
CASE
WHEN ol.opengraph_image_artist IS NOT NULL AND ol.opengraph_image_artist != '' AND ol.opengraph_image_artist != '/' THEN ol.opengraph_image_artist
ELSE NULL
END
) AS metadata
FROM
optimized_listens ol
WHERE
@ -13,7 +26,7 @@ WHERE
GROUP BY
ol.artist_name,
ol.artist_art,
ol.artist_url
ol.artist_url,
ol.opengraph_image_artist
ORDER BY
plays DESC;