Commit Graph

2 Commits

Author SHA1 Message Date
type-two
fce64c72d3 fix(cache): build_disc_cache wrote NULL artists it did not have to
The builder read release.artists_sort alone, which is NULL for roughly 9.1M of
the 10.4M releases in this dump, and cached that NULL. Not merely a blank column:
recordgod's admin inventory list runs its artist SEARCH and SORT on dc.artist
too, so an affected record becomes unfindable by artist name. Genre, style, label
and country all looked fine on the same row because those read disc_release_*;
the artist is the one catalog field where this cache is the only source.

Seen on release 447087 - cached as title "Mezcal", artist NULL, showing a dash in
the admin list, while Discogs plainly says Urban D.K.

The name was never missing. release_artist has it regardless of artists_sort, so
fall back to that. extra=0 is the RELEASE artist: extra=1 rows are credits, and
447087 also lists Carl Clarke and Jim Eliot as Producers, so folding those in
would be worse than the blank. Comma-joined rather than reconstructing Discogs
join_strings, since this only fires where artists_sort is already NULL.

Verified against the mirror: 447087 to Urban D.K. and 564101 to Idjut Boys are
recovered, while 3018249 (Skirt (7)) and 314753 (Dahlback & Dahlback) still come
from artists_sort unchanged. No credits leak in.

This mattered urgently because the builder TRUNCATEs disc_cache and rebuilds, so
the next run would have silently undone the prod backfill of those two rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 13:50:04 +10:00
5c10bdc06d feat: self-contained enrichment — disc_cache (own catalog copy), no external DB dependency
- schema: disc_cache (release_id→title/artist/thumb/weight); build_disc_cache.py populates it
  from the full Discogs dump on ultra (30,694 stocked releases).
- app/mirror.py: enrich() now reads RecordGod's OWN disc_cache via the main DB — no live
  discogs_full / dealgod-DB dependency. DealGod reached only via API key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 13:16:56 +10:00