Repository navigation
fix(catalog): restore spanned-episode playable-target resolution - #424
Merged
Merged
Conversation
The #419 sync replaced the playable-target resolver's episode-leaf file check with the alias-aware predicate and dropped the multi-episode branch in both the backend-neutral and PostgreSQL winner paths. A file linked only to the first episode of an S01E01-E02 range then resolved no play target for the later episode, so spanned cards would not play. Accept a spanning file alongside a direct or alias-owned file on the episode leaf. The spanning behavior returns from 5f36edd (Silo-Server#3112); the existing DB contract test TestMultiEpisodeFileServesSpannedEpisodesDB covers it again. Refs Silo-Server#739
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Spanned episodes of a multi-episode file resolve to no play target. When a file named
S01E01-E02links only to its first episode, the second episode is listed and has a file, but its card resolves an empty target and cannot play.The playable-target resolver lost its spanning-file branch during the #419 sync (
64f3d12b5). That commit replaced the episode-leaf file check with the alias-aware predicate and did not carry the multi-episode branch into either the backend-neutral query or the PostgreSQL winner path.Related issue: N/A
Validation tasks: none
Approach
The episode leaf now accepts a file that spans the requested episode, in addition to a direct file or one owned by an alias row. The backend-neutral query and both PostgreSQL episode-leaf checks use the same predicate, so the two paths agree.
This restores the behavior from
5f36eddb8(Silo-Server#3112) and makes the existingTestMultiEpisodeFileServesSpannedEpisodesDBcontract test pass again. There is no schema, migration, or API change.Validation
go build ./...passes.go vetpasses oninternal/catalogandinternal/scanner.TestMultiEpisodeFileServesSpannedEpisodesDBfails on main atinternal/scanner/multi_episode_file_test.go:88and passes with this change against a freshly migrated PostgreSQL 18 database. The test is registered inscripts/ci/db-contracts.txt, so the Trusted Linux CI db-contracts job runs it.internal/catalogandinternal/scannersuites pass against the same database, including the backend-neutral/PostgreSQL parity and alias-file resolver tests. One earlier full run hit an unrelated planner-stats flake inTestRatingsPageIndexDB; it passed on rerun and on base.make lint-changedreports 0 issues againstkipsilabs/main.I also checked a spanned episode through both resolver paths with a temporary test; both returned the spanned episode. It was removed before the commit, leaving the DB contract test as the regression coverage.
Risks
None identified. The change only widens the present-file predicate for an episode leaf; series/season candidates and anchor hints keep their current behavior.
Checklist
AI Disclosure
deepseek-v4.1-flash:1017