Movie name cleaning diverges from upstream on punctuation #8

Closed
opened 2026-08-02 14:27:22 +02:00 by Claude · 1 comment
Collaborator

268 of 284 movie names match upstream. The 16 that do not are all the name
cleaner being more aggressive about punctuation:

upstream                                   ours
(T)Raumschiff Surprise - Periode 1 (2004)  TRaumschiff Surprise Periode 1
Dungeons & Dragons Honor Among Thieves     Dungeons and Dragons Honor Among Thieves
I, Robot (2004)                            I Robot
Manitou's Shoe (2001)                      Manitous Shoe
Lara Croft Tomb Raider - The Cradle of Life  Lara Croft Tomb Raider The Cradle of Life
Star Wars Episode 1 - The Phantom Menace   Star Wars Episode I The Phantom Menace

Note upstream keeps the year in Name exactly where its own parser failed to
read one — Star Trek Section 31 () is upstream's output, empty parentheses
included. Matching upstream means reproducing that too.


Found by scanning /mnt/media (285 movies, 289 shows, 74 music artists —
~13 000 media files on a CIFS mount) with both this server and upstream
Jellyfin at the pinned commit, remote metadata and image fetchers disabled on
upstream so both were reading files only. Upstream was given the same mount
path so MD5(UTF-16LE(path)) agrees and rows compare directly.

268 of 284 movie names match upstream. The 16 that do not are all the name cleaner being more aggressive about punctuation: upstream ours (T)Raumschiff Surprise - Periode 1 (2004) TRaumschiff Surprise Periode 1 Dungeons & Dragons Honor Among Thieves Dungeons and Dragons Honor Among Thieves I, Robot (2004) I Robot Manitou's Shoe (2001) Manitous Shoe Lara Croft Tomb Raider - The Cradle of Life Lara Croft Tomb Raider The Cradle of Life Star Wars Episode 1 - The Phantom Menace Star Wars Episode I The Phantom Menace Note upstream keeps the year in `Name` exactly where its own parser failed to read one — `Star Trek Section 31 ()` is upstream's output, empty parentheses included. Matching upstream means reproducing that too. --- Found by scanning `/mnt/media` (285 movies, 289 shows, 74 music artists — ~13 000 media files on a CIFS mount) with both this server and upstream Jellyfin at the pinned commit, remote metadata and image fetchers disabled on upstream so both were reading files only. Upstream was given the same mount path so `MD5(UTF-16LE(path))` agrees and rows compare directly.
Author
Collaborator

Fixed in 67805f3.

The diagnosis in this issue was wrong. It is not a punctuation-cleaning
divergence — our CLEAN_STRINGS is byte-identical to upstream's. Upstream names
a film after its folder, verbatim, wherever the folder holds it alone
(MovieResolver.cs:491, movie.Name = Path.GetFileName(movie.ContainingFolderPath)),
and we were always naming from the cleaned file. The folder says
I, Robot (2004); the file says I Robot (2004) [imdbid-tt0343818] - [...].

All 284 movie names now match upstream, up from 268.

Review found the first cut of the guard too loose, and three regressions in it,
all now fixed and pinned:

  • upstream counts the films when deciding a film is alone, so a trailer beside
    one does not cost it the folder's name — but it counts extras too when
    deciding whether it is among siblings. Two predicates, not one.
  • a folder holding a directory is one upstream reads as discs and as no film at
    all, so it does not name the film
  • a disc of a release is not the release: without that guard a film inside
    CD 01 or VIDEO_TS was being named after the plumbing

That a disc rip is filed once per disc rather than once per release is unchanged
and is #26.

Fixed in `67805f3`. **The diagnosis in this issue was wrong.** It is not a punctuation-cleaning divergence — our `CLEAN_STRINGS` is byte-identical to upstream's. Upstream names a film after its **folder**, verbatim, wherever the folder holds it alone (`MovieResolver.cs:491`, `movie.Name = Path.GetFileName(movie.ContainingFolderPath)`), and we were always naming from the cleaned file. The folder says `I, Robot (2004)`; the file says `I Robot (2004) [imdbid-tt0343818] - [...]`. **All 284 movie names now match upstream**, up from 268. Review found the first cut of the guard too loose, and three regressions in it, all now fixed and pinned: - upstream counts the *films* when deciding a film is alone, so a trailer beside one does not cost it the folder's name — but it counts extras too when deciding whether it is among siblings. Two predicates, not one. - a folder holding a directory is one upstream reads as discs and as no film at all, so it does not name the film - a disc of a release is not the release: without that guard a film inside `CD 01` or `VIDEO_TS` was being named after the plumbing That a disc rip is filed once per disc rather than once per release is unchanged and is #26.
Sign in to join this conversation.
No description provided.