Skip to content

fix(catalog): restore spanned-episode playable-target resolution - #424

Merged
randrini merged 1 commit into
mainfrom
fix/spanned-episode-target
Nov 7, 2026
Merged

randrini merged 1 commit into
mainfrom
fix/spanned-episode-target

Conversation

@randrini

@randrini randrini commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

Spanned episodes of a multi-episode file resolve to no play target. When a file named S01E01-E02 links 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 existing TestMultiEpisodeFileServesSpannedEpisodesDB contract test pass again. There is no schema, migration, or API change.

Validation

  • go build ./... passes.
  • go vet passes on internal/catalog and internal/scanner.
  • TestMultiEpisodeFileServesSpannedEpisodesDB fails on main at internal/scanner/multi_episode_file_test.go:88 and passes with this change against a freshly migrated PostgreSQL 18 database. The test is registered in scripts/ci/db-contracts.txt, so the Trusted Linux CI db-contracts job runs it.
  • The full internal/catalog and internal/scanner suites 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 in TestRatingsPageIndexDB; it passed on rerun and on base.
  • make lint-changed reports 0 issues against kipsilabs/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

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md. (No tests are added; the existing DB contract test covers the restored behavior.)
  • The Evidence section shows every change a user can see, or says there is none. (The only user-visible change is the restored play target; there is no media to attach.)

AI Disclosure

  • Harness: OpenCode
  • Tool(s): OpenCode coding agent
  • Model(s): deepseek-v4.1-flash:1017
  • Involvement: Fully AI-generated; human verification pending
  • Adversarial review: n/a

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
@randrini
randrini marked this pull request as ready for review November 7, 2026 19:59
@randrini
randrini merged commit a74d009 into main Nov 7, 2026
11 checks passed
@randrini
randrini deleted the fix/spanned-episode-target branch November 27, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant