A scan files one row where upstream files a row per alternate version #207
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?
VideoInfo::alternate_versionsis never read.grep alternate_versions crates/ephyra-appreturns nothing —movie_noderesolves a group and then keeps only the primary, so where upstream files a row per version, we file one.Upstream
upstream/MediaBrowser.Controller/Entities/Video.cs:583—RefreshMetadataForVersionswalksLocalAlternateVersions, callingResolveAlternateVersion→CreateItem, so each version is its own row linked to the primary. The grouping itself isVideoListResolver.IsEligibleForMultiVersion.The fixture says it is covered and is not
xtask/src/reference/kinds.rslays downVersions/Anthem.mp4andVersions/Anthem - 1080p.mp4with the comment "Two cuts of one title, which this kind groups and the photo kinds do not."Upstream filed two separate rows, both
in_mixed_folder: true. No grouping happened at all:VideoListResolver.IsEligibleForMultiVersion(:180) requires the filename to start with the folder name, and"Anthem"does not start with"Versions". So the case in the answer key cannot exercise what its comment claims, and the port agrees with upstream on it for the wrong reason.Renaming the folder to
Anthem/turns it into a real case — and would then fail, which is the point.Reach
crates/ephyra-http/tests/versions.rscovers serving versions that already exist as rows; this is about the scan producing them.crates/ephyra-http/src/map/media.rs:51,160gives each source its own runtime, which is also what #203 needs.Found reviewing #194.
Landed on
main:2a5a91ec,5a2ff728,085fdd2a,f06fbc21,f66e2ab8.What changed
Each entry of
VideoInfo::alternate_versionsis now a row (version_nodes,crates/ephyra-app/src/scan/tree/movies.rs): filed under the type the title took, named by its own file, owned by the title, carrying its mixed-folder flag — and held by the title's own parent. Upstream's key settled that last part:Anthem - 1080p.mp4hasparent: /kinds/musicvideos, where a stack's later part has none.Two defects a real scan found that no tree test could
OwnerIdis an immediate foreign key and rows were filed in path order. That is safe for a parent, which is a prefix of its child's path, but an owner is not above what it owns:Anthem - 1080p.mkvsorts beforeAnthem.mkv, so a real scan failed the whole task withFOREIGN KEY constraint failed. Stack parts had only worked by luck (cd1<cd2).filed_in_order(scan/library.rs) now files owners first.Both are pinned in
crates/ephyra-app/tests/scan_write.rsagainst an in-memory database, and each goes red with its half reverted.Verified
library_kindstest agrees.Anthem, not two — the owned cut is hidden on the same predicate upstream uses.Not done here — filed
PrimaryVersionId,LocalAlternateVersion), so it is not yet served as a second media source.