fix: distinguish a title collision from an attribution miss, and index for it
Build and publish container / build (pull_request) Successful in 5m16s

Two faults in the split added last change, both visible in the first real run.

It reported 700 pairs as attribution disagreements on the strength of the
library holding the same title under a different artist. The examples show what
that actually caught: "Everyday" matched Def Leppard, "Kaleidoscope" matched
Chappell Roan, "Fight for Your Right" matched Motley Crue. Different songs that
happen to share a name. Across fifty thousand tracks that is not an edge case,
it is the common case, and presenting it as a matcher failure argues for exactly
the title-only matching tier that would produce this rubbish on purpose.

The signal for a real attribution miss is narrower: the library's own title
credits the artist the play is filed under, as in "Voodoo People (Pendulum
Remix)" against a scrobble credited to Pendulum. The normalised title has that
suffix stripped -- which is what let the two meet in the first place -- so the
raw title is searched for the name. Collisions are now counted and named
separately, as what they are.

The same query also took forty-seven seconds. lidarr_track was indexed on
(norm_artist, norm_title), which a lookup by title alone cannot use because its
leading column is the artist, so every unmatched key scanned all eighty-four
thousand tracks. Add the index on the title by itself; the query plan changes
from an automatic partial index to a covering one.
This commit is contained in:
Emma Thorpe
2026-08-24 17:35:32 +01:00
parent d1c10d32d9
commit 61ce751ac5
3 changed files with 122 additions and 30 deletions
+13 -9
View File
@@ -110,17 +110,21 @@ unmatched by an artist the library holds: N pairs, M plays
```
That is a track that was played by an artist the library holds. It is then
split again, because owning an artist is a weak proxy for owning a track:
split three ways, because owning an artist is a weak proxy for owning a track
and a shared title is a weak proxy for a shared song:
- **the title exists under another artist** — an attribution disagreement, a
remixer or a guest billed as the artist. These are the genuine misses, and
each is a candidate for being wrongly called cold in stage four. The report
names the artist the library files them under.
- **the title is nowhere in the library** — never bought. No amount of matching
conjures a file that does not exist.
- **the library's own title credits the scrobbled artist** — `Voodoo People
(Pendulum Remix)` against a play credited to Pendulum. Same song, filed
under the original artist. These are the genuine misses.
- **the same title under an unrelated artist** — a collision, not a miss.
Across fifty thousand tracks these are constant: `Everyday` is Rusko and
also Def Leppard, `Kaleidoscope` is Delta Heavy and also Chappell Roan.
Matching on title alone would be far worse than missing them, which is why
there is no such tier.
- **the title is nowhere in the library** — never bought.
Counting both as matcher failures overstates the problem and would over-block
the cull. The report lists the worst of each by play count.
Only the first is worth chasing. Counting all three as matcher failures
overstates the problem and would over-block the cull.
## How the ingest works