Test data and example comments named real artists, records and songs, and
carried real MusicBrainz ids. One mapping swaps them for invented ones
throughout (Fields of Ontario, Plastic Apes, Marlo Davies, ...), keeping
what each case tests: sort order, index letter, escaping, title keys,
artist-prefix stripping. A test username is no longer the operator's name.
The cover-art and Last.fm connection checks still query real releases;
they reach live services and need something that exists there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scan has marked missing files since f6d1cf24 and every selection
path filters them out, so they cause no harm -- and are invisible. The
operator found out about the first batch only because an unrelated MBID
backfill logged "no such file or directory" forty times.
GET /api/admin/library/missing reports them, grouped by directory. The
grouping is the whole ergonomic argument: the case that produced #2523
was three reorganised albums, which a flat list renders as forty
unrelated problems and a folder list renders as three decisions.
ListMissingTracks orders by directory so the handler can fold runs
without a map, which also keeps the query's ordering instead of Go's
random map iteration.
Each row carries last_played_at, nullable, because "gone six months,
never played" and "gone yesterday, played 200 times" deserve opposite
reactions and a file path tells you neither. The correlated MAX needs
its ::timestamptz cast or sqlc infers interface{} and the Go layer
loses the type.
Read-only, deliberately. Nothing here deletes: a missing file keeps its
row, its play history and its likes because it may come back, and if it
comes back renamed the scanner adopts it (#2528). The route sits under
/library rather than /tracks so it can't be confused with the
destructive DELETE /admin/tracks/{id} beside it.