fix(copyright): suppress self-match flags before they reach UI/DM (#1341)
flo.by uploaded his catalog; AuDD identified each track's dominant
match as "Floby IV" (his stage name). every scan returned
is_flagged=true, which:
- showed a red "potential copyright violation" badge to the
artist on his own /portal page
- fired an admin DM ("copyright flag on plyr.fm / primary: X
by Floby IV") — admin received ~30 DMs in one session
`sync_copyright_resolutions` flipped is_flagged=false within 5min,
but only after the artist had already seen the flag and the DM
spam had landed.
fix: in `_store_scan_result`, look up the uploader's artist record
when is_flagged=true and compare slugified forms of the dominant
match artist to the uploader's handle and display name. on a
self-match, demote is_flagged to false at write time so the UI
flag and the DM never fire. logs `copyright self-match suppressed`
for observability.
separate semantic bug (sync flipping flags whose URI was never
labelled, not just negated) is unaddressed here — this is the
short-term fix to stop creator-visible flags + DM spam.
Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
authored by