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:
2026-04-19 19:02:27 +00:00
parent 97eb91f50b
commit acd2c7f034
+9
View File
@@ -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;