Files
minstrel/internal/scrobble/threshold.go
T
bvandeusenandClaude Opus 5.5 da21becead Revert the deliberate break (#8299)
Run 11302 failed all ten named tests, and with them apierror's
TestWrite_SendsTheEnvelopeAndHidesAPlainErrorsText and api's
TestFlag_BadReason, which pin the same rules from the handler side.

This reverts commit 21adbc2283.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:30:55 -05:00

15 lines
676 B
Go

// Package scrobble owns the outbound-scrobble pipeline: threshold detection,
// the queue write path, and the worker goroutine. The HTTP client is in
// internal/scrobble/listenbrainz; this package consumes it.
package scrobble
// Qualifies returns true if a closed play_event meets ListenBrainz's
// recommended scrobble threshold: ≥240 seconds played OR ≥50% of the
// track length played.
//
// The two thresholds are deliberately separate from the skip-detection
// thresholds, which feed the scoring formula's skip penalty instead.
func Qualifies(durationPlayedMs int, completionRatio float64) bool {
return durationPlayedMs >= 240_000 || completionRatio >= 0.5
}