docs: wanted, dbtest, recommendation and playlists comments say what the code does (#6277)
The same rewrite as d191a282, for four packages whose comments carried the
most history: tuning stories, quotes from the operator, single-install
measurements in library_scale.go, and 'used to' accounts of bugs. The
constraint each story protected stays as a present-tense reason (why tier 3
is reduced not removed, why the randomised arms take an order seed, why the
seed artist is eligible in Songs-like). Comments naming system_cron.go and
config.RecommendationConfig, neither of which holds what they claimed, now
name the scheduler and internal/recsettings.
Checked: non-comment tokens identical to HEAD; gofmt clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,10 +11,9 @@ import (
|
||||
"git.fabledsword.com/bvandeusen/minstrel/internal/db/dbq"
|
||||
)
|
||||
|
||||
// Discovery mixes (#419-423). One generic producer + per-mix spec.
|
||||
// Replaces the five near-identical produceXxx functions that all
|
||||
// fetched ranked (id, album_id, artist_id) rows, diversified,
|
||||
// truncated, and emitted a single playlist.
|
||||
// Discovery mixes: one generic producer + a per-mix spec. Each mix fetches
|
||||
// ranked (id, album_id, artist_id) rows, diversifies, truncates, and emits a
|
||||
// single playlist.
|
||||
//
|
||||
// Day-keying is a per-mix property captured by `dailyRotate`:
|
||||
//
|
||||
@@ -40,7 +39,7 @@ import (
|
||||
// Discover so shuffle-on-play has a varied pool within a day.
|
||||
const discoveryMixLen = 100
|
||||
|
||||
// Minimum viable mix sizes (issue #1246): below the floor the variant
|
||||
// Minimum viable mix sizes: below the floor the variant
|
||||
// is withheld entirely so Home renders its "listen more to unlock"
|
||||
// placeholder — a playlist with a couple of songs reads as a build
|
||||
// bug, not a mix. Album-coherent mixes (NewForYou / FirstListens) get
|
||||
@@ -68,7 +67,7 @@ type discoveryMixSpec struct {
|
||||
|
||||
// minLen is the minimum viable mix size: a finished pool below it
|
||||
// is withheld (no playlist row) so the client renders the locked
|
||||
// placeholder instead of a mix that looks built-wrong (#1246).
|
||||
// placeholder instead of a mix that looks built-wrong.
|
||||
minLen int
|
||||
|
||||
// fetch returns the raw ranked rows. dateStr is supplied for
|
||||
@@ -109,10 +108,10 @@ func produceDiscoveryMix(spec discoveryMixSpec) systemPlaylistProducer {
|
||||
// so each day's downstream truncate-to-N surfaces a different slice
|
||||
// while contiguous-block ordering inside the slice is preserved.
|
||||
//
|
||||
// Rotation happens WITHIN each contiguous same-pick-kind block
|
||||
// (#1267): tiered mixes arrive tier-ordered, and a whole-pool
|
||||
// Rotation happens WITHIN each contiguous same-pick-kind block:
|
||||
// tiered mixes arrive tier-ordered, and a whole-pool
|
||||
// rotation would hoist tier-3 filler above tier-1's exact fits.
|
||||
// Untiered pools are a single block, which reduces to the original
|
||||
// Untiered pools are a single block, which reduces to a plain
|
||||
// whole-pool rotation (same seed, same first draw). Empty /
|
||||
// single-element pools pass through unchanged.
|
||||
func rotateForDay(pool []discoverTrack, userID pgtype.UUID, dateStr string) []discoverTrack {
|
||||
|
||||
Reference in New Issue
Block a user