chore: remove code left from acquisition and Discover suggestions, and uncalled queries
Nothing reached any of it: - MusicBrainz search (artists, albums, songs), artist lookups and the query escaping they used. The release-group lookups the duplicate resolver uses stay. - Release-group covers, and artist-level tags for artists not in the library. - Nine named queries with no caller (CountTracksByArtist went with the previous commit), two of them describing request-progress reporting. The MusicBrainz client's retry and not-found tests now drive the release-group lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -412,36 +412,6 @@ func (q *Queries) PickSeedArtists(ctx context.Context, userID pgtype.UUID) ([]Pi
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const pickTopAlbumCoverForArtistByUser = `-- name: PickTopAlbumCoverForArtistByUser :one
|
||||
SELECT a.cover_art_path
|
||||
FROM albums a
|
||||
LEFT JOIN tracks t ON t.album_id = a.id
|
||||
LEFT JOIN play_events pe
|
||||
ON pe.track_id = t.id
|
||||
AND pe.user_id = $1
|
||||
AND pe.was_skipped = false
|
||||
WHERE a.artist_id = $2
|
||||
AND a.cover_art_path IS NOT NULL
|
||||
GROUP BY a.id, a.release_date, a.cover_art_path
|
||||
ORDER BY COUNT(pe.id) DESC, a.release_date DESC NULLS LAST, a.id
|
||||
LIMIT 1
|
||||
`
|
||||
|
||||
type PickTopAlbumCoverForArtistByUserParams struct {
|
||||
UserID pgtype.UUID
|
||||
ArtistID pgtype.UUID
|
||||
}
|
||||
|
||||
// "Songs like X" cover. Most-played album by user; tie-break by most-recent
|
||||
// release. NULL if the artist has no albums or all covers are NULL.
|
||||
// Note: albums uses cover_art_path (not cover_path).
|
||||
func (q *Queries) PickTopAlbumCoverForArtistByUser(ctx context.Context, arg PickTopAlbumCoverForArtistByUserParams) (*string, error) {
|
||||
row := q.db.QueryRow(ctx, pickTopAlbumCoverForArtistByUser, arg.UserID, arg.ArtistID)
|
||||
var cover_art_path *string
|
||||
err := row.Scan(&cover_art_path)
|
||||
return cover_art_path, err
|
||||
}
|
||||
|
||||
const pickTopPlayedTrackForArtistByUser = `-- name: PickTopPlayedTrackForArtistByUser :one
|
||||
SELECT COALESCE(
|
||||
(SELECT t.id
|
||||
|
||||
Reference in New Issue
Block a user