mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 20:11:50 -07:00
fix: stabilized the order of top items
This commit is contained in:
parent
a1b6724179
commit
c9042e19ad
6 changed files with 12 additions and 12 deletions
|
|
@ -49,7 +49,7 @@ JOIN tracks_with_title t ON l.track_id = t.id
|
|||
JOIN releases r ON t.release_id = r.id
|
||||
WHERE l.listened_at BETWEEN $1 AND $2
|
||||
GROUP BY t.id, t.title, t.musicbrainz_id, t.release_id, r.image
|
||||
ORDER BY listen_count DESC
|
||||
ORDER BY listen_count DESC, t.id
|
||||
LIMIT $3 OFFSET $4;
|
||||
|
||||
-- name: GetTopTracksByArtistPaginated :many
|
||||
|
|
@ -68,7 +68,7 @@ JOIN artist_tracks at ON at.track_id = t.id
|
|||
WHERE l.listened_at BETWEEN $1 AND $2
|
||||
AND at.artist_id = $5
|
||||
GROUP BY t.id, t.title, t.musicbrainz_id, t.release_id, r.image
|
||||
ORDER BY listen_count DESC
|
||||
ORDER BY listen_count DESC, t.id
|
||||
LIMIT $3 OFFSET $4;
|
||||
|
||||
-- name: GetTopTracksInReleasePaginated :many
|
||||
|
|
@ -86,7 +86,7 @@ JOIN releases r ON t.release_id = r.id
|
|||
WHERE l.listened_at BETWEEN $1 AND $2
|
||||
AND t.release_id = $5
|
||||
GROUP BY t.id, t.title, t.musicbrainz_id, t.release_id, r.image
|
||||
ORDER BY listen_count DESC
|
||||
ORDER BY listen_count DESC, t.id
|
||||
LIMIT $3 OFFSET $4;
|
||||
|
||||
-- name: CountTopTracks :one
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue