A local alternate version is filed but never joined to the title it is a cut of #214
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?
#207 made a scan file a row per alternate version. It does not join that row to the one it is a cut of, so the versions exist and are not served as versions:
/Videos/{id}hands back one media source where upstream hands back several.What is missing
Upstream links a version three ways (
upstream/MediaBrowser.Controller/Entities/Video.cs,LibraryManager.ResolveAlternateVersion):PrimaryVersionIdon the version's rowPresentationUniqueKey, shared with the primaryLinkedChildType.LocalAlternateVersionrowWe write the first of nothing:
crates/ephyra-db/src/scan/row.rs:20-38has noPrimaryVersionIdcolumn in its insert, andcrates/ephyra-db/src/items/writes.rs:624-627says outright that nothing in this server produces aLocalAlternateVersion. The scan setsOwnerIdand stops there.Why nothing looks broken today
Owner-only filing is safe as far as listings go — the default filter already hides
OwnerId IS NOT NULL AND ExtraType IS NULL(crates/ephyra-db/src/query/filters.rs:405-413), so no duplicate film appears in a library view. The row is reachable by id and by nothing else, which is why #207 could land without a user-visible regression.What it costs
A client asking for a film with two cuts gets one
MediaSourcesentry.crates/ephyra-db/src/items/repository.rs:124-147reads onlyChildType = 3, so the join has no reader either.This is the half of #207 that its own "Reach" section points at, and it overlaps #203 (the selected source's runtime) and #211 (the selected source's streams): all three want a session or a read to resolve which source is in play.
Verifying
crates/ephyra-http/tests/versions.rscovers serving versions that already exist as rows; the fixture now lays down a real multi-version group (musicvideos/Anthem/, added for #207), so an end-to-end scan-then-read is reachable for the first time.Found reviewing #207.
Fixed in
74adf6e5,1c4a86cband53ac9c6c, landed onmain.The join. A scan files a cut with
PrimaryVersionId, the title's presentation key, and aLocalAlternateVersionlink rebuilt from the title's blob after each pass. A rewrite changes the primary and the key only for rows the scan owns, so a merge made by hand survives a rescan, and a row filed by an older pass is joined on the next one. A music video now gets a video blob at all, so its parts and cuts are stored.The read side.
/Items/{id}servesMediaSourcesandMediaSourceCountfor the group, andPlaybackInfoserves and negotiates every version, honouringmediaSourceIdon POST and ignoring it on GET as upstream does. Source names use upstream's common-prefix rule, whose own test table is ported fromBaseItemTests.cs. A group member the account may not see is left out; the asked row stays.Verified against upstream's own answers for the fixture's two version groups, by regenerating the answer key with four new columns (
owner,primary_version,local_alternate_versions,versions), and by a native end-to-end scan: both groups joined, no foreign-key errors, and a second pass stable.The review caught two things, both fixed: the session and resume readers could not see the new link type, so playing a scanned cut reported the title's runtime and no streams and did not suppress its siblings from
/Items/Resume; and asking a page forMediaSourcesmade a query per row, where the count beside it was batched. Both go through one batched group read now.Known and left:
MediaSourceCountis the group's size rather than what the account may see, which is how upstream'sVideo.GetMediaSourceCountcounts it too. How the sources are ordered and named is filed as #229.