A film alone in a disc folder takes the wrong folder's name #206
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A film alone in a disc folder is named after the grandparent here and after the disc folder upstream. The port's rule has no basis in upstream's code, and a test asserts the port's answer as though it were upstream's.
The case
/movies/I, Robot (2004)/CD 01/I Robot (2004).mkvUpstream:
MovieResolver.FindMovieonCD 01findsresult.Items.Count == 1, no photos and no subfolders, withcollectionType == movies, and so takesMovieResolver.cs:484-487:ContainingFolderPathfor a non-stackedVideoFileisGetDirectoryName(Path)=…/CD 01, so the row is namedCD 01. There is no disc exception anywhere on that path —AllExtrasTypesFolderNamesis checked, disc-folder names are not.Ours:
crates/ephyra-app/src/scan/tree/movies.rs:244and:428suppress the folder name whenis_a_disc, givingI Robot.Why this is worse than a plain divergence
crates/ephyra-app/tests/scan.rs:651asserts it, with the comment "the disc does not name it either" — so the port's own invention is written down as upstream's behaviour. A later reader has no way to tell the assertion from a verified one. Whichever way it is settled, the test's comment has to stop claiming upstream says this.It is possible the port's answer is the nicer one for a user. That is not the question the harness answers; if it is kept deliberately it belongs in
DECISIONS.md(seeDECISIONS.md:1150-1155), not in a test comment.Verifying
This was found by reading
MovieResolver.cs,Video.csandBaseItem.csand probing the port — not by a real upstream scan, because the tree the answer key covers contains no such case.cargo xtask reference gen-library-kindsnow stands up its own container; addingmovies/I, Robot (2004)/CD 01/…to its tree settles it in one run.Found reviewing #194.
Landed on
main:2a5a91ec,5a2ff728,e0653be6.Settled in upstream's favour, and confirmed by a real scan rather than argued:
movies/I, Robot (2004)/CD 01/I Robot (2004).mp4is aMovienamedCD 01, year 2004, under aFolderI, Robot (2004). Theis_a_discsuppression is gone.tests/scan.rsno longer claims upstream says otherwise —a_film_alone_in_a_disc_folder_takes_that_folders_nameasserts upstream's answer. NoDECISIONS.mdentry: the port now matches.One correction to the reasoning in
2a5a91ec, from review:VIDEO_TS,streamandplaylistfolders can reachfilms()(aVIDEO_TSholding a plain.mkvand no.vobis not a rip). Removing the suppression is still right there —FindMovienames that filmVIDEO_TStoo.Verified
movies/Recital - cd1/cd2), a film alone in a disc folder (movies/I, Robot (2004)/CD 01/…), andmusicvideos/Versions/renamed toAnthem/so its files really start with the folder name.gen-library-kindswas regenerated from a live upstream container and everylibrary_kindstest agrees with it.filed_in_orderwas probed against two levels of ownership, a diamond, a cycle and an owner outside the batch. Mutation-checked: each change reverted alone turns its own tests red.Anthem,CD 01 · 2004,ConcertandLoose Film · 1999— no secondAnthemfrom the owned cut and no stack part — which is the same predicate upstream hides them on (BaseItemRepository.TranslateQuery.cs:810-814).On an existing install, an incremental scan decides a row is unchanged from its file (path, mtime, size), so rows filed before this change keep their old value until the file is touched or a full refresh runs. New rows are right immediately.