feat: Your genres leads with the genres you play most, not A to Z
release / web (push) Successful in 1m8s
release / go (push) Successful in 1m40s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 3m43s
release / android (push) Successful in 4m21s
release / Build signed APK (push) Successful in 4m55s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m8s
release / go (push) Successful in 1m40s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 3m43s
release / android (push) Successful in 4m21s
release / Build signed APK (push) Successful in 4m55s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
The genre mix builder already ranks genres by how much you listen to them (taste profile, then plays and likes, then library size), but the rank was lost when the mixes were stored and both apps sorted the shelf by name. Each playlist now has a shelf_rank (migration 0107), which the genre builder fills 1..n in that listening order, even where it picked a narrower genre before a broader one. The list and detail endpoints carry it, and the web and Android Home sort the genre shelf by it, unranked playlists after by name. Android's playlist cache gains the column (Room v14). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -243,3 +243,24 @@ func TestSelectGenreMixes_LibraryGenresOnlyFillAShortShelf(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The shelf leads with the genre the user listens to most, even when it was
|
||||
// picked after narrower ones: Rock ranks first though Pop Punk was built
|
||||
// before it.
|
||||
func TestSelectGenreMixes_ShelfRankFollowsListeningNotPickOrder(t *testing.T) {
|
||||
cands := []genreCandidate{
|
||||
genreOf("Rock", 1, songs(1, 1000)), // broad: half its songs are Pop Punk
|
||||
genreOf("Pop Punk", 1, songs(1, 500)), // specific, so picked first
|
||||
genreOf("Jazz", 1, songs(3000, 3100)),
|
||||
}
|
||||
got := selectGenreMixes(cands, buildN(30))
|
||||
if names := labels(got); len(names) != 3 || names[0] != "Pop Punk mix" || names[2] != "Rock mix" {
|
||||
t.Fatalf("pick order = %v, want Pop Punk first and Rock last", names)
|
||||
}
|
||||
want := map[string]int32{"Rock mix": 1, "Pop Punk mix": 2, "Jazz mix": 3}
|
||||
for _, b := range got {
|
||||
if b.ShelfRank != want[b.Name] {
|
||||
t.Errorf("%s shelf rank = %d, want %d", b.Name, b.ShelfRank, want[b.Name])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user