A studio and a genre parsed from an NFO are dropped #61

Closed
opened 2026-08-04 09:55:00 +02:00 by Claude · 1 comment
Collaborator

A studio and a genre parsed from an NFO are dropped.

scan/nfo.rs reads <studio> and <genre>, and run.rs::local_metadata
(around line 962) applies neither — it takes overview, original_title,
sort_title, provider_ids, title and year and leaves the rest on the
floor. So this port records no ItemValues of type Studios at all, and the
studio validator ported alongside the genre and artist ones has never had real
data to run against.

Recording them is not a one-line change: it wants a studios field on
item::Write, a Studios binding in the insert column list, an
ItemValueType::Studios arm in list_under including its delete clause, and a
matching field in item::Tracked / filed() / summary::describes — otherwise
the unchanged-detection starts re-filing every folder on each pass.

Found while porting the by-name validators (#57, #60).

A studio and a genre parsed from an NFO are dropped. `scan/nfo.rs` reads `<studio>` and `<genre>`, and `run.rs::local_metadata` (around line 962) applies neither — it takes `overview`, `original_title`, `sort_title`, `provider_ids`, `title` and `year` and leaves the rest on the floor. So this port records no `ItemValues` of type `Studios` at all, and the studio validator ported alongside the genre and artist ones has never had real data to run against. Recording them is not a one-line change: it wants a `studios` field on `item::Write`, a `Studios` binding in the insert column list, an `ItemValueType::Studios` arm in `list_under` including its delete clause, and a matching field in `item::Tracked` / `filed()` / `summary::describes` — otherwise the unchanged-detection starts re-filing every folder on each pass. Found while porting the by-name validators (#57, #60).
Author
Collaborator

A studio and a genre an NFO names now reach the row.

Upstream reads <studio> (BaseNfoParser.cs:437) and <genre> split on /
(:576-591), de-duplicating case-insensitively and keeping the first spelling.
Both land in two places: the BaseItems.Studios/Genres columns as a
|-joined list (BaseItemMapper.cs:257,284) and one ItemValues row each of
type 3 and type 2 (ItemPersistenceService.cs:661). This port now does both.

Nothing is double-recorded. The genres already here come from container tags,
and local_metadata runs before the probe while embedded() only fills what is
empty — which is upstream's own order.

One extra path fell out of it: the prober already derives studios from
copyright for a video, and only the video path consumed it upstream. Wired
into embedded() and deliberately not into a track's tags, matching
AudioFileProber.

Measured on a purpose-built NFO library:

written
ItemValues type Studios 5
ItemValues type Genre 4
Studio by-name rows 5
Genre by-name rows 4

with the columns in upstream's shape — Studios = 'Brandywine Productions|20th Century Fox', and '' rather than NULL where nothing is named. That is the
first real data the studio validator ported in #57 has ever had.

The rescan invariant holds, checked three ways: a real double scan
(written=0 summarised=0, zero rows with a moved DateLastSaved), a new
regression test over a real database, and the full suite. The earlier scoping
of this issue was over-cautious — item::Tracked and summary::describes need
no studios field, because they compare only what a music folder's summary
decides, and studios are not summarised from tracks.

Two things worth recording.

This writes nothing on the measured library. All three libraries under
/mnt/media hold zero .nfo files, so the change adds no rows there. It agrees
with offline upstream before and after, both at 0 studios.

The production database is not the answer key for studios. It ran with TMDB,
TVDB and MusicBrainz enabled — 95,610 provider rows — so its 830 studios are
production companies and record labels fetched from the internet, not anything
derivable from the files. var/big-upstream, which is upstream over the same
library with providers disabled, records 0. I had pointed this work at the wrong
database and the measurement caught it.

Not verified: the /Studios and /Genres HTTP listings, because this port
serves no /Startup/User, so no account can be created against a fresh
database. Compared at the row level instead.

A studio and a genre an NFO names now reach the row. Upstream reads `<studio>` (`BaseNfoParser.cs:437`) and `<genre>` **split on `/`** (`:576-591`), de-duplicating case-insensitively and keeping the first spelling. Both land in two places: the `BaseItems.Studios`/`Genres` columns as a `|`-joined list (`BaseItemMapper.cs:257,284`) and one `ItemValues` row each of type 3 and type 2 (`ItemPersistenceService.cs:661`). This port now does both. Nothing is double-recorded. The genres already here come from container tags, and `local_metadata` runs before the probe while `embedded()` only fills what is empty — which is upstream's own order. One extra path fell out of it: the prober already derives studios from `copyright` for a video, and only the video path consumed it upstream. Wired into `embedded()` and deliberately not into a track's tags, matching `AudioFileProber`. Measured on a purpose-built NFO library: | | written | |---|---| | `ItemValues` type Studios | 5 | | `ItemValues` type Genre | 4 | | `Studio` by-name rows | 5 | | `Genre` by-name rows | 4 | with the columns in upstream's shape — `Studios = 'Brandywine Productions|20th Century Fox'`, and `''` rather than `NULL` where nothing is named. That is the first real data the studio validator ported in #57 has ever had. **The rescan invariant holds**, checked three ways: a real double scan (`written=0 summarised=0`, zero rows with a moved `DateLastSaved`), a new regression test over a real database, and the full suite. The earlier scoping of this issue was over-cautious — `item::Tracked` and `summary::describes` need no studios field, because they compare only what a music folder's summary decides, and studios are not summarised from tracks. Two things worth recording. **This writes nothing on the measured library.** All three libraries under `/mnt/media` hold zero `.nfo` files, so the change adds no rows there. It agrees with offline upstream before and after, both at 0 studios. **The production database is not the answer key for studios.** It ran with TMDB, TVDB and MusicBrainz enabled — 95,610 provider rows — so its 830 studios are production companies and record labels fetched from the internet, not anything derivable from the files. `var/big-upstream`, which is upstream over the same library with providers disabled, records 0. I had pointed this work at the wrong database and the measurement caught it. Not verified: the `/Studios` and `/Genres` HTTP listings, because this port serves no `/Startup/User`, so no account can be created against a fresh database. Compared at the row level instead.
Sign in to join this conversation.
No description provided.