chore: fix related books + deduplication

- fixed total plays formatting
- formatted queries
- improved proxy server
This commit is contained in:
Cory Dransfeldt 2024-10-21 12:04:17 -07:00
parent ab50866bb8
commit d2c4c78ff7
No known key found for this signature in database
40 changed files with 985 additions and 1357 deletions

View file

@ -5,18 +5,16 @@ SELECT
COUNT(*) AS plays,
ol.album_art,
ol.artist_url,
json_build_object(
'title', ol.album_name,
'image', ol.album_art,
'url', ol.artist_url,
'alt', CONCAT(ol.album_name, ' by ', ol.artist_name),
'subtext', ol.artist_name
) AS grid
json_build_object('title', ol.album_name, 'image', ol.album_art, 'url', ol.artist_url, 'alt', CONCAT(ol.album_name, ' by ', ol.artist_name), 'subtext', ol.artist_name) AS grid
FROM
optimized_listens ol
WHERE
TO_TIMESTAMP(ol.listened_at) >= NOW() - INTERVAL '30 days'
GROUP BY
ol.album_name, ol.artist_name, ol.album_art, ol.artist_url
ol.album_name,
ol.artist_name,
ol.album_art,
ol.artist_url
ORDER BY
plays DESC;
plays DESC;