feat(recommendation): SuggestArtists service for M5c
Add per-user artist-suggestion service ranking out-of-library MBIDs by signal x similarity. Single-CTE SQL collects user likes (5x weight) and recency-decayed plays, joins against artist_similarity_unmatched, and filters in-library candidates plus non-terminal lidarr_requests. The service resolves top-3 attribution seeds to artist names in a batched GetArtistsByIDs call so the UI can render "because you liked X" reasons. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,3 +37,8 @@ SELECT COUNT(*) FROM artists;
|
||||
|
||||
-- name: CountArtistsMatching :one
|
||||
SELECT COUNT(*) FROM artists WHERE name ILIKE '%' || $1::text || '%';
|
||||
|
||||
-- name: GetArtistsByIDs :many
|
||||
-- Batched lookup used by M5c suggestion attribution to resolve top-3
|
||||
-- contributing seed UUIDs back to artist names in one round-trip.
|
||||
SELECT * FROM artists WHERE id = ANY($1::uuid[]);
|
||||
|
||||
Reference in New Issue
Block a user