mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 13:38:15 -08:00
fix: associate tracks with release when scrobbling (#118)
This commit is contained in:
parent
d327729bff
commit
c346c7cb31
12 changed files with 58 additions and 1794 deletions
|
|
@ -27,14 +27,15 @@ FROM tracks_with_title t
|
|||
JOIN artist_tracks at ON t.id = at.track_id
|
||||
WHERE at.artist_id = $1;
|
||||
|
||||
-- name: GetTrackByTitleAndArtists :one
|
||||
-- name: GetTrackByTrackInfo :one
|
||||
SELECT t.*
|
||||
FROM tracks_with_title t
|
||||
JOIN artist_tracks at ON at.track_id = t.id
|
||||
WHERE t.title = $1
|
||||
AND at.artist_id = ANY($2::int[])
|
||||
AND at.artist_id = ANY($3::int[])
|
||||
AND t.release_id = $2
|
||||
GROUP BY t.id, t.title, t.musicbrainz_id, t.duration, t.release_id
|
||||
HAVING COUNT(DISTINCT at.artist_id) = cardinality($2::int[]);
|
||||
HAVING COUNT(DISTINCT at.artist_id) = cardinality($3::int[]);
|
||||
|
||||
-- name: GetTopTracksPaginated :many
|
||||
SELECT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue