sqlc: add CountTracksByAlbum and SearchTracks for Subsonic browse (#295)
CountTracksByAlbum drives the songCount attr on AlbumRef; SearchTracks backs the song facet of search3.
This commit is contained in:
@@ -27,3 +27,12 @@ SELECT * FROM tracks WHERE file_path = $1;
|
||||
|
||||
-- name: ListTracksByAlbum :many
|
||||
SELECT * FROM tracks WHERE album_id = $1 ORDER BY disc_number NULLS LAST, track_number NULLS LAST;
|
||||
|
||||
-- name: CountTracksByAlbum :one
|
||||
SELECT count(*) FROM tracks WHERE album_id = $1;
|
||||
|
||||
-- name: SearchTracks :many
|
||||
SELECT * FROM tracks
|
||||
WHERE title ILIKE '%' || $1 || '%'
|
||||
ORDER BY title
|
||||
LIMIT $2 OFFSET $3;
|
||||
|
||||
Reference in New Issue
Block a user