feat: search/merge items by id

This commit is contained in:
Gabe Farrell 2025-06-21 14:25:31 -04:00
parent 5537b6fb89
commit 1425f7f416
9 changed files with 752 additions and 46 deletions

View file

@ -344,6 +344,7 @@ func (q *Queries) GetTopTracksPaginated(ctx context.Context, arg GetTopTracksPag
const getTrack = `-- name: GetTrack :one
SELECT
t.id, t.musicbrainz_id, t.duration, t.release_id, t.title,
get_artists_for_track(t.id) AS artists,
r.image
FROM tracks_with_title t
JOIN releases r ON t.release_id = r.id
@ -356,6 +357,7 @@ type GetTrackRow struct {
Duration int32
ReleaseID int32
Title string
Artists []byte
Image *uuid.UUID
}
@ -368,6 +370,7 @@ func (q *Queries) GetTrack(ctx context.Context, id int32) (GetTrackRow, error) {
&i.Duration,
&i.ReleaseID,
&i.Title,
&i.Artists,
&i.Image,
)
return i, err