Three folders the scan walk treats as leaves where upstream resolves through them #213
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?
Three folders where upstream keeps walking and we stop. All three are one shape — the walk treats a directory as a leaf that upstream resolves through — and all three are pre-existing rather than introduced by #208, which is where they were found.
1. A directory below a
Seasoncrates/ephyra-app/src/scan/tree/shows.rsmakes every directory under a series aSeasonand reads nothing below it./tv/Show/Season 01/Bonus/{Show S01E02.mkv, track.mp3}upstream:SeasonResolverneedsargs.Parent is SeriesandMovieResolverbails onHasParent<Series>(), soFolderResolver(Last) claimsBonus— thenEpisodeResolverreaches the file inside it, finding the season throughparent.GetParents().OfType<Season>(). Upstream filesFolder("Bonus")and anEpisode; we file neither.2. An extras folder beside a film that does not collapse
/movies/Double/{Alpha.mkv, Beta.mkv, Extras/Bonus.mkv}: becauseDoubleholds two films it keeps its own row, and upstream then filesFolder("Extras")andMovie("Bonus")inside it — theDirectoryNameextra rule is suppressed on that second pass, wherefullDirectory == libraryRoot(upstream/Emby.Server.Implementations/Library/Resolvers/ExtraRuleResolver.cs:51). We drop the subtree.An extras folder beside a film that does collapse is correctly not an item, which is the case the fixture covers today — hence the gap.
3. A series subfolder holding no video
upstream/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs:88-94returns null whenhasAnyVideois false, falling through toFolder. We make every subdirectory of a series aSeason, so aArtwork/orSubs/folder beside the seasons becomes one.Why they are worth one issue
Each is a directory we treat as a leaf. The fix in all three is the same question — what the walk does below a node it has already claimed — and settling it once is cheaper than three times.
Verifying
cargo xtask reference gen-library-kindscovers all three: thetvshowstree has no season subfolder and no non-video folder under a series, and themoviestree has no extras beside a folder that keeps its row. Three entries, one run.Found reviewing #208.
Two of the three are fixed in
fe6b37c8, landed onmainat53ac9c6c. The third was wrong about upstream.1. A directory below a season.
folder_atnow walks through any folder under a series that is not itself a season, soSeason 01/Bonus/Show S01E02.mkvfiles aFolderand the episode inside it, with the season number taken from the nearest season. The key agrees.3. A series subfolder holding no video.
is_a_seasonappliesSeasonResolver's rule: named as a season, or else not episode-named and holding a video somewhere below. AnArtwork/folder beside the seasons is aFolderon both sides now.2. An extras folder beside a film that does not collapse — not a bug. The key shows upstream files no row for
movies/Double/ExtrasorDouble/Extras/Bonus.mp4. The issue misreadExtraRuleResolver.cs:51: theDirectoryNamerule is suppressed only whenfullDirectory == libraryRoot, and herefullDirectoryis…/Double/Extras, never the root. SoBonus.mp4stays an extra, and it is an extra of a plainFolder, which carries none. Our walk drops extras directories, so both sides file nothing, and the row-by-row comparison would fail if either did.For contrast, the key does file
movies/Extras Beside (2011)/Extras/Bonus.mp4, owned by the film that collapsed into its folder — the case that already worked.