chore: fix related books + deduplication
- fixed total plays formatting - formatted queries - improved proxy server
This commit is contained in:
parent
ab50866bb8
commit
d2c4c78ff7
40 changed files with 985 additions and 1357 deletions
|
@ -14,7 +14,11 @@ WITH track_stats AS (
|
|||
WHERE
|
||||
TO_TIMESTAMP(ol.listened_at) >= NOW() - INTERVAL '7 days'
|
||||
GROUP BY
|
||||
ol.track_name, ol.artist_name, ol.album_name, ol.album_art, ol.artist_url
|
||||
ol.track_name,
|
||||
ol.artist_name,
|
||||
ol.album_name,
|
||||
ol.album_art,
|
||||
ol.artist_url
|
||||
)
|
||||
SELECT
|
||||
track_name,
|
||||
|
@ -24,14 +28,10 @@ SELECT
|
|||
last_listened,
|
||||
album_art,
|
||||
artist_url,
|
||||
json_build_object(
|
||||
'title', track_name,
|
||||
'artist', artist_name,
|
||||
'url', artist_url,
|
||||
'plays', plays,
|
||||
'alt', CONCAT(track_name, ' by ', artist_name),
|
||||
'subtext', CONCAT(album_name, ' (', plays, ' plays)'),
|
||||
'percentage', ROUND((plays::decimal / most_played) * 100, 2)
|
||||
) AS chart
|
||||
FROM track_stats
|
||||
ORDER BY plays DESC, last_listened DESC;
|
||||
json_build_object('title', track_name, 'artist', artist_name, 'url', artist_url, 'plays', plays, 'alt', CONCAT(track_name, ' by ', artist_name), 'subtext', CONCAT(album_name, ' (', plays, ' plays)'), 'percentage', ROUND((plays::decimal / most_played) * 100, 2)) AS chart
|
||||
FROM
|
||||
track_stats
|
||||
ORDER BY
|
||||
plays DESC,
|
||||
last_listened DESC;
|
||||
|
||||
|
|
Reference in a new issue