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

@ -13,17 +13,11 @@ SELECT
ol.album_art,
ol.artist_url,
ol.genre_url,
json_build_object(
'title', ol.track_name,
'subtext', ol.artist_name,
'alt', CONCAT(ol.track_name, ' by ', ol.artist_name),
'url', ol.artist_url,
'image', ol.album_art,
'played_at', ol.listened_at
) AS chart
json_build_object('title', ol.track_name, 'subtext', ol.artist_name, 'alt', CONCAT(ol.track_name, ' by ', ol.artist_name), 'url', ol.artist_url, 'image', ol.album_art, 'played_at', ol.listened_at) AS chart
FROM
optimized_listens ol
WHERE
TO_TIMESTAMP(ol.listened_at) >= NOW() - INTERVAL '7 days'
ORDER BY
TO_TIMESTAMP(ol.listened_at) DESC;
TO_TIMESTAMP(ol.listened_at) DESC;