From 5b8034edca2262acb20832012171a84693cc9274 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Mon, 30 Mar 2026 03:14:53 -0400 Subject: [PATCH] fix: distinguish unknown popularity from confirmed zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Artists not in the explore index had HasPopularity=false and Popularity=0, making them indistinguishable from confirmed zero-popularity artists like Shannon Hale. The strict threshold (60) was filtering all non-indexed MB results. Now three states: - Known popular (HasPop=true, Pop>0) → sliding threshold - Known unpopular (HasPop=true, Pop=0) → strict threshold (60) - Unknown (HasPop=false) → lenient threshold (15) Non-indexed MB results are 'unknown' and pass with any reasonable score. Only artists confirmed to have zero listens face the high bar. --- backend/explore/explore.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/explore/explore.go b/backend/explore/explore.go index f2f5a2b..8533ff4 100644 --- a/backend/explore/explore.go +++ b/backend/explore/explore.go @@ -842,12 +842,18 @@ func scalePopularity(listens int) int { // 100K listens → threshold 24 // 1M+ listens → threshold 15 (almost anything passes) func minScoreForArtist(a MBArtist) int { + // Unknown popularity (not in index, no LB lookup yet) — + // use lenient threshold since we can't judge. + if !a.HasPopularity { + return minBlendedScore + } + + // Known zero popularity — strict threshold. if a.Popularity <= 0 { return minScoreZeroPop } - // log10(pop) ranges from ~2 (100 listens) to ~6+ (1M+). - // Scale to 0-1 range using 6.0 as the reference ceiling. + // Known popularity — threshold slides down with listen count. const logCeiling = 6.0 // log10(1,000,000) logPop := math.Log10(float64(a.Popularity))