fix: use dominant match detection for copyright flagging (#748)
AudD doesn't return confidence scores - the `score` field was always
empty and defaulting to 0. This broke copyright detection after #703
reintroduced score-based thresholding.
New approach: count how many times each unique (artist, title) appears
across matched segments. If one song dominates (>= 30% of matches),
flag it. This filters out false positives where random segments match
different songs due to common chord progressions or drum patterns.
For track 594 (MARINA - BUTTERFLY):
- 18/53 matches (33%) were MARINA - BUTTERFLY
- Next highest was 11/53 (20%) for Eugenio Tokarev
- Would now correctly flag at 30% threshold
Changes:
- Add find_dominant_match() to count matches per unique song
- Flag based on dominant_match_pct >= threshold (default 30%)
- Add dominant_match and dominant_match_pct to scan response
- highest_score now always 0 (legacy field)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
authored by