The first public release of Fabled Minstrel #158

Merged
bvandeusen merged 256 commits from dev into main 2026-12-03 21:41:58 -05:00
Showing only changes of commit 8251fef604 - Show all commits
+8 -3
View File
@@ -15,13 +15,18 @@ import (
)
// seedGenre creates artists × perArtist tracks tagged genre, each artist on
// its own album, and returns the tracks.
// its own album, and returns the tracks. seedTrack mints a new artist on
// every call (an artist without an mbid has no conflict key), so each
// artist's first track creates it and the rest join that track's album.
func seedGenre(t *testing.T, pool *pgxpool.Pool, genre string, artists, perArtist int) []dbq.Track {
t.Helper()
var out []dbq.Track
for a := 0; a < artists; a++ {
for k := 0; k < perArtist; k++ {
tr := seedTrack(t, pool, fmt.Sprintf("%s %d-%d", genre, a, k), fmt.Sprintf("%s Artist %d", genre, a))
first := seedTrack(t, pool, fmt.Sprintf("%s %d-0", genre, a), fmt.Sprintf("%s Artist %d", genre, a))
setGenre(t, pool, first.ID, genre)
out = append(out, first)
for k := 1; k < perArtist; k++ {
tr := seedTrackForArtist(t, pool, fmt.Sprintf("%s %d-%d", genre, a, k), first.AlbumID, first.ArtistID)
setGenre(t, pool, tr.ID, genre)
out = append(out, tr)
}