Skip to content

feat(catalog): add a video_with_episodes search scope - #1995

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:feat/catalog-search-episodes-scope
Oct 8, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:feat/catalog-search-episodes-scope

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1249
Validation tasks: changes Silo-Server/silo-apple#307 C3; changes Silo-Server/silo-apple#308 C3; changes Silo-Server/silo-apple#337 C1; changes Silo-Server/silo-apple#338 C1

A v2 client cannot search movies, series and episodes together while leaving out audiobooks and books. type=video covers movies and series only, and an unknown value is dropped, which searches every media type. The iOS app sends video for "All" when audiobooks are hidden, so a search for an episode title such as "Pilot" finds nothing.

This adds a video_with_episodes scope for text search and advertises it as a capability, so clients can opt in and keep video on older servers.

Approach

  • /api/v2 accepts type=video_with_episodes on the query source. A text search (nonempty q) returns movies, series and episodes ranked together, with no audiobooks, ebooks or manga.
  • Without q, and for getCatalogFilters and searchCatalogFacet, it covers the same rows as video, because browse never mixes episode rows into media items.
  • Other sources answer 422 at query.type (body.type on POST catalog/query). Stored definitions (smart collections, sections) still reject the value.
  • listPeople accepts it as media_scope.
  • getCatalogSearchCapabilities advertises video_with_episodes_scope: true.
  • Regenerated the OpenAPI artifact, the capability fixture and the web v2 types; docs/catalog-api.md documents the scope.

The change is additive. video keeps its meaning everywhere, and /api/v1 still drops the value. Older servers drop it on the catalog (searching every type) and refuse it on listPeople, so clients must check the capability flag and fall back to video.

Validation

  • go build, go vet, gofmt, make lint-changed: pass.
  • make test-go: the only failures are the hardware-acceleration, transcode and probe tests that also fail on main on the test machine (macOS, no VAAPI, QSV or NVIDIA devices). A few timing tests that failed once while the machine was loaded passed on three reruns.
  • make verify-settings-bindings-all, the other verify-* targets in CONTRIBUTING, and the router artifact test: pass.
  • Web: pnpm run lint, format:check, build, budget:check and make test-web (739 files, 5,786 tests): pass.
  • Tests cover scope expansion, definition validation, v1 and v2 parsing, the provider request, the v2 handler, the capability and people search. A PostgreSQL end-to-end search test over the relevance, sorted and rule-filtered paths was added; it skips without SILO_TEST_DATABASE_URL and was not run locally.
  • Manual, iOS simulator against a server built from this branch: "All" search for "Pilot" lists Breaking Bad S01E01, using the iOS change in the companion app PR.

With Apple #630, All search uses this capability to include episodes and people credited only on episodes. That expands the results in the previously passed iOS and tvOS People-search C3 cases; re-run those cases after merge, along with Series search C1 on both platforms.

Supplementary evidence covers people search with media_scope=video_with_episodes and no-query browse with type=video_with_episodes, using the same synthetic fixture.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-1995/

Evidence

No first-party client sends video_with_episodes yet, so these are API excerpts. Same request both times, as the admin's profile, trimmed to each result's type and title (episodes also show their series):

GET <server>/api/v2/catalog?type=video_with_episodes&q=Pilot

Before

{
  "total": 5,
  "items": [
    { "type": "episode", "title": "Pilot", "series_title": "Maple Street", "season_number": 1, "episode_number": 1 },
    { "type": "episode", "title": "Pilot", "series_title": "Harbor Lights", "season_number": 1, "episode_number": 1 },
    { "type": "episode", "title": "Pilot", "series_title": "Open Road", "season_number": 1, "episode_number": 1 },
    { "type": "audiobook", "title": "The Pilot" },
    { "type": "movie", "title": "The Pilot Light" }
  ]
}

After

{
  "total": 4,
  "items": [
    { "type": "episode", "title": "Pilot", "series_title": "Maple Street", "season_number": 1, "episode_number": 1 },
    { "type": "episode", "title": "Pilot", "series_title": "Harbor Lights", "season_number": 1, "episode_number": 1 },
    { "type": "episode", "title": "Pilot", "series_title": "Open Road", "season_number": 1, "episode_number": 1 },
    { "type": "movie", "title": "The Pilot Light" }
  ]
}

Before, the server ignored the unknown value and searched every media type, so the audiobook appeared. After, the audiobook is left out. type=video&q=Pilot returns only "The Pilot Light" on both builds.

GET <server>/api/v2/catalog/search/capabilities

Before

{ "people_media_scope": true, "person_prefetch": true, "provider": "postgres" }

After

{ "people_media_scope": true, "person_prefetch": true, "video_with_episodes_scope": true, "provider": "postgres" }

Surface and build: /api/v2/catalog search and /api/v2/catalog/search/capabilities; before c762177 (main at this PR's base), after 09c4ac1 (PR head). Test library with Movies, TV, Mixed and Audiobooks libraries and synthetic files; the three "Pilot" episodes and the audiobook "The Pilot" are in the test library.

Risks

None identified. Clients that do not read the capability keep their current behaviour.

Merge order: Silo-Server/silo-apple#630 vendors this branch's fixtures and needs one more fixture sync after this merges. The app works against servers with or without this change.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code, running in T3 Code; Codex harness in T3 Code (review cleanup)
  • Tool(s): Claude Code subagents, Go toolchain, Docker, GitHub CLI
  • Model(s): claude-opus-5-5; gpt-6.1-sol
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code reviewer agent (claude-opus-5-5) read this branch's diff against main at medium effort, checking API compatibility, behaviour, tests and commit hygiene. It confirmed the change is additive on /api/v2, that browse, filters and saved definitions are unaffected, and that /api/v1 ignores the value. No findings.

Note

Add video_with_episodes search scope to catalog API

  • Adds a search-only video_with_episodes media scope for people and catalog search. The new ParseCatalogRequestWithOptions parser in catalog_parser.go accepts it as a request type, stores it on the new CatalogRequest.SearchMediaScope field, and rejects it for non-query sources with ErrSearchMediaScopeSource.
  • The scope expands to movie, series, and episode item types. Direct searches send an unscoped definition to the search provider so the episode branch is not narrowed by the ordinary video browse scope.
  • The capabilities endpoint now advertises video_with_episodes_scope=true, and the OpenAPI contract, generated web schema, and catalog-api.md docs are updated. See catalog_items.go and catalog_search_capabilities.go.
  • Behavioral Change: parseCatalogRequest in the v2 adapter now reports search-scope source errors at query.type instead of the generic source location. Stored query definitions still reject video_with_episodes via IsValidMediaScope; only request parsing accepts it.

Macroscope summarized 85f20af.

Problem: a v2 search client cannot ask for movies, series, and episodes while leaving out audiobooks and books. The catalog type parameter takes one media scope; video covers movies and series only, and an unrecognized value is dropped, which searches every media type. iOS search sends video for All when audiobooks are hidden, so episodes never appear (silo-apple#337 C1).

Change: /api/v2 accepts type=video_with_episodes on the query source. A text search (nonempty q) returns movies, series, and episodes ranked together, with no audiobooks, ebooks, or manga. Without q, and for getCatalogFilters and searchCatalogFacet, it covers the same rows as video, since browse never mixes episode rows into media items. Other sources answer 422 at query.type (body.type on POST catalog/query), and stored definitions (smart collections, sections) still reject the value. listPeople accepts it as media_scope. getCatalogSearchCapabilities advertises video_with_episodes_scope: true.

Compat: additive. video keeps its meaning everywhere. The /api/v1 grammar is unchanged and still drops the value. Older servers drop it on the catalog (searching every type) and refuse it on listPeople, so clients must check the capability flag and fall back to video.

Tests: scope expansion, definition validation, v1/v2 parsing, provider request, and a PostgreSQL end-to-end search over relevance, sorted, and rule-filtered paths; v2 handler, capability, and people tests. Regenerated the OpenAPI artifact, the capability fixture, and the web v2 types.
@silo-kody

silo-kody Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8a4fb29b-02b3-4b68-b87d-ff2b17bcd803
📥 Commits

Reviewing files that changed from the base of the PR and between 09c4ac1 and 85f20af.

📒 Files selected for processing (3)
  • internal/apiv2/catalog_items_test.go
  • internal/catalog/catalog_parser.go
  • internal/catalog/media_scope_test.go
ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5cc7ebd4-b056-4650-b867-9e47fe7c9886
📥 Commits

Reviewing files that changed from the base of the PR and between c762177 and 09c4ac1.

📒 Files selected for processing (17)
  • contracts/api/v2/fixtures/get_catalog_search_capabilities_ok.json
  • contracts/api/v2/openapi.json
  • docs/catalog-api.md
  • internal/apiv2/catalog_actions.go
  • internal/apiv2/catalog_actions_test.go
  • internal/apiv2/catalog_items.go
  • internal/apiv2/catalog_items_test.go
  • internal/apiv2/catalog_search_capabilities.go
  • internal/apiv2/catalog_search_capabilities_test.go
  • internal/catalog/catalog_parser.go
  • internal/catalog/catalog_request.go
  • internal/catalog/catalog_resolver.go
  • internal/catalog/catalog_resolver_test.go
  • internal/catalog/media_scope_test.go
  • internal/catalog/query_definition.go
  • internal/catalog/search_video_with_episodes_db_test.go
  • web/src/api/v2/schema.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Adds the video_with_episodes media scope for query-source text searches and people searches. Catalog text searches include movies, series, and episodes; browse and facet operations use the existing video scope. The v2 API exposes a capability flag and documents source restrictions and fallback behavior.

Changes

Video-with-episodes search scope

Layer / File(s) Summary
Parse and resolve the search-only scope
internal/catalog/query_definition.go, internal/catalog/catalog_request.go, internal/catalog/catalog_parser.go, internal/catalog/catalog_resolver.go, internal/catalog/*_test.go
The request stores SearchMediaScope separately from its browse scope. The parser accepts video_with_episodes for query-source searches, and the resolver searches movie, series, and episode item types. Tests cover scope matching, source validation, provider requests, and database-backed search behavior.
Expose the scope through v2 API
internal/apiv2/catalog_items.go, internal/apiv2/catalog_items_test.go, internal/apiv2/catalog_actions.go, internal/apiv2/catalog_actions_test.go, internal/apiv2/catalog_search_capabilities.go, internal/apiv2/catalog_search_capabilities_test.go
The v2 catalog parser enables search scopes and reports unsupported sources at the type field. People search accepts the scope. The capabilities response advertises video_with_episodes_scope.
Describe the scope in API contracts
contracts/api/v2/openapi.json, contracts/api/v2/fixtures/*, docs/catalog-api.md, web/src/api/v2/schema.ts
The OpenAPI contract, web schema, and documentation describe search and browse behavior, people-search support, and the capability flag. The capability fixture revision changes.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CatalogAPI
  participant ParseCatalogRequestWithOptions
  participant CatalogResolver
  participant catalogSearchAccess
  participant SearchProvider
  CatalogAPI->>ParseCatalogRequestWithOptions: Parse query with search scopes enabled
  ParseCatalogRequestWithOptions-->>CatalogAPI: Return request with SearchMediaScope
  CatalogResolver->>catalogSearchAccess: Select search item types
  catalogSearchAccess-->>CatalogResolver: Return movie, series, and episode types
  CatalogResolver->>SearchProvider: Search with selected item types and unscoped definition
Loading

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to 09c4a

This change adds an episode-inclusive search scope to the v2 API, gated by a capability flag and left out of browse and facets. No concrete merge-blocking risk was found. The PostgreSQL end-to-end test has not been run locally, so run it in CI before merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 09c4a

The new search option retains existing visibility checks and leaves ordinary browsing unchanged. No introduced access bypass was identified. Clients must check support before using the option, and verification remains incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The intended exposure change is candidate composition within an authenticated viewer's catalog, not a new privilege class. Movies, series, and episodes were already selectable individually; the new option combines them while retaining effective access restrictions.

Trust Boundaries and Controls

  • observed — People search checks viewer identity and obtains a context-derived access filter before forwarding the caller's media scope to SearchPeopleScoped. The service passes both scope and access filter to the existing repository; its downstream credit SQL was not fully inspected in this pass.
  • observed — Continuation state remains bound to the request and viewer: Meilisearch validates a digest including candidate types and effective access, while the API authenticates account/profile identity, viewer policy, filters, and sort. PostgreSQL relies on that outer cursor envelope and reruns access-filtered queries.

Resilience and Maintainability Implications

  • observed — Meilisearch ranking sessions store immutable candidate IDs with fixed expiry and atomic retention management. Each page rehydrates through current access checks; expired or mismatched sessions reject continuation. Initial fallback occurs before session persistence, and established continuation remains provider-bound.
🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 65.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 13 files. (4 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the video_with_episodes search scope to the catalog API.
Description check ✅ Passed The description directly explains the new search scope, API behavior, compatibility, validation, tests, and client capability handling.
Full details: Docstring Coverage

Explanation

Docstring coverage is 65.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 13 files. (4 skipped: 3 unsupported, 1 too large.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp

macroscopeapp Bot commented Oct 5, 2026

Copy link
Copy Markdown

Validation tasks says this PR unblocks Silo-Server/silo-apple#337 C1, but that task records C1 as Not run and has no failed/blocked finding. This change therefore does not unblock a recorded result. Please replace the line with:

Validation tasks: none

C1 still needs initial human validation; this check does not treat an unrun case as unblocked or passed.

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@Rhainland

Copy link
Copy Markdown
Contributor Author

Changed the line to changes Silo-Server/silo-apple#337 C1: no C1 result was blocked, so "unblocks" was wrong. I kept the reference rather than none, because this changes what C1 search returns on iOS (episodes under "All", via Silo-Server/silo-apple#630), and the validator should re-run C1 once both land.

Quick104 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Silo's pull request guidance changed today (#2016). A PR that changes what a user sees now needs before-and-after evidence in its Evidence section, and a PR with no visible change says Evidence: none, no user-visible change. This PR was opened before the rule existed, so it hasn't had a chance to meet it yet.

Missing here: Before-and-after excerpts of the catalog search response for the same query (for example 'Pilot') listing result titles, or screenshots of the client search.

The rules are in Show visible changes, and the PR template shows the Evidence section layout. I've converted this PR to draft for now. Mark it ready for review once the Evidence section is filled in.


Generated by Claude Code

@Quick104
Quick104 marked this pull request as draft October 6, 2026 19:24
@Rhainland
Rhainland marked this pull request as ready for review October 6, 2026 20:06
@macroscopeapp

macroscopeapp Bot commented Oct 6, 2026

Copy link
Copy Markdown

The excerpts cover the text-search results and capability flag, but not these other visible behaviors:

  • internal/apiv2/catalog_actions.go: media_scope=video_with_episodes now returns people credited on episodes. Please add before-and-after responses for the same people query using that scope.
  • internal/catalog/catalog_parser.go: a catalog request with type=video_with_episodes and no q now lists video items rather than treating the value as unrecognized. Please add before-and-after responses for the same no-query browse.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@macroscopeapp

macroscopeapp Bot commented Oct 6, 2026

Copy link
Copy Markdown

The validation impact line omits two previously passed People-search cases and the tvOS Series search case. In silo-apple#307 C3 and #308 C3, the accepted build was app 01ff70de with server 941 · 82b5b39e. Apple’s default hides Audiobooks, so All used video; merged Apple #630 now reads the new capability and sends video_with_episodes for both title and people search. With this server PR, episode cards and people with episode-only credits can appear. The PR should explicitly explain this expansion of previously validated results, and both C3 cases need re-validation after merge.

#338 C1 is also affected: tvOS uses the shared SearchViewModel, and its case includes item and people search. Its results table is still Not run. Keep #337 C1 as changes, not unblocks: its table is Not run, and the issue comment records only a rehearsal, not RC/device validation.

Suggested Validation tasks: line:

-Validation tasks: changes Silo-Server/silo-apple#337 C1
+Validation tasks: changes Silo-Server/silo-apple#307 C3; changes Silo-Server/silo-apple#308 C3; changes Silo-Server/silo-apple#337 C1; changes Silo-Server/silo-apple#338 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@Rhainland

Copy link
Copy Markdown
Contributor Author

Added same-query people responses using media_scope=video_with_episodes and no-q catalog browse using type=video_with_episodes. Updated the validation line and rationale for Apple’s previously passed People-search cases and the shared tvOS search path. Those passed cases need re-validation.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-1995/

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 09c4ac1. The scope does what the description says on both search providers. Episodes come back, audiobooks don't, video keeps its meaning, /api/v1 ignores the value, and stored definitions refuse it. Cursors and Meilisearch ranking sessions both bind the item types, so page 2 matches page 1 on any node. TestResolveVideoWithEpisodesSearch passes against a freshly migrated PostgreSQL database.

Two findings are inline. A summary comment follows with the remaining notes, including two older search bugs that this scope makes easier to reach.


Review by Claude Code (claude-opus-5-5), with a read-only cross-check by Codex (gpt-6.1-sol).

Comment thread internal/catalog/catalog_parser.go Resolved
Q string `query:"q" maxLength:"200" doc:"Name prefix or fragment; empty lists the first people"`
Limit int `query:"limit" minimum:"1" maximum:"100" default:"20" doc:"Most people to answer"`
MediaScope string `query:"media_scope" enum:"video,movie,series,episode,audiobook,ebook,manga" doc:"Restrict people to accessible credits in this media scope; omitted searches all media scopes"`
MediaScope string `query:"media_scope" enum:"video,video_with_episodes,movie,series,episode,audiobook,ebook,manga" doc:"Restrict people to accessible credits in this media scope; omitted searches all media scopes. video covers movies and series; video_with_episodes adds episodes (check getCatalogSearchCapabilities.video_with_episodes_scope first)"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low, needs your call: on real libraries, media_scope=video_with_episodes probably returns the same people as video.

PersonRepository.search reaches credits only through item_people JOIN media_items mi ... mi.type = ANY(...). Every production ReplacePeople caller writes credits for a media item: metadata enrichment for movies and series, plus the audiobook, ebook and manga paths. Episodes live in episodes, not media_items, so I found no path that stores an episode-typed credit. The existing media_scope=episode has the same gap, so this predates the PR.

Impact: the parameter doc, docs/catalog-api.md and the capability description say the scope "adds episodes". The description also says Apple's All search will now surface "people credited only on episodes", and the #307 C3 / #308 C3 entries rest on that. If no such credits exist, people search doesn't change for those cases. The people half of the evidence page would then show a synthetic fixture rather than real data. I couldn't check a real library's item_people rows, so treat this as likely rather than confirmed.

Options:

  1. Keep the value on listPeople for symmetry with the catalog scope, and reword the docs to say it matches video until episode credits are stored.
  2. Drop it from listPeople, and keep the capability description to the catalog.

Either way, the validation note for the two People-search C3 cases may need to change. I'm leaving this one to you.

…ource

A section request carrying type=video_with_episodes failed the section's
overlay check first, so the 422 named query.source (body.source on POST)
instead of the documented query.type. Refuse the search-only scope on any
recognized non-query source before the per-source checks run, and correct
the comment that said only the query source runs a text search.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Quick104 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: 85f20af (the PR's 09c4ac1 plus one fix commit from this review).

Fit: 8/10 · Readiness: 7/10 — conditional

Addressed

  • The 422 for type=video_with_episodes now names query.type (body.type on POST) for every recognized non-query source, including section, which used to report query.source. Fixed in 85f20af, with GET and POST section cases added.

Open

  • Needs your call: on real libraries, listPeople with media_scope=video_with_episodes probably matches the same people as video, because no production path stores episode credits in item_people. The inline thread lays out the options. Your choice also decides whether the #307 C3 / #308 C3 entries describe a real change in people results.

Older bugs this scope makes easier to reach (not introduced here)

A video_with_episodes search takes the same mixed movie-and-episode search path that an unscoped q search already uses. I reproduced two defects against PostgreSQL with no type at all, so they predate this PR:

  • sort=latest_episode_added on a text search fails with column mi.latest_episode_added_at does not exist.
  • name_prefix is ignored on a sorted text search.

Codex also traced two more that I haven't reproduced. Meilisearch ranking windows apply the query limit before the maturity filter. File-based sorts (resolution, bitrate) give episodes no sort key.

Apple's All search will now route through this path, so these deserve their own issue. They don't belong in this PR.

Validated features

The changed behaviour is opt-in: only requests that send the new value see a difference. No passed case regresses.

  • silo-apple#307 C3 and #308 C3 (People search) could change only through the people-scope behaviour above. If episode credits never exist, people results don't change.
  • silo-apple#337 C1 and #338 C1 are still Not run. The PR's Validation tasks: line lists them, but that line normally names passed cases only. Moving them to a separate note would match the convention.
  • The server, web and Android People-search cases are unaffected (#1143 C2, #1144 C3, silo-android#317 C3, #318 C3).

Other checks

  • Search providers: both return episodes under the item-type restriction. Meilisearch falls back to PostgreSQL when its index leaves out episodes, so video_with_episodes_scope: true is truthful in every configuration. Cursors and ranking sessions both bind the item types.
  • Contract: additive on /api/v2. /api/v1 and stored definitions are unchanged, and the OpenAPI artifact, fixture and web types match the Go tags. jellycompat needs nothing.
  • User manual: unaffected. The manual doesn't document API search scopes.
  • Apple/Android: Apple Surface exact client app version and build on the Activity page #630 is merged. Android's search sends video for its Video filter, so Android has the same gap with episodes. I'd recommend a silo-android issue to adopt the capability.
  • Evidence: the existing page still matches. The fix changes only an error location for a request no client sends.
  • Tests: focused internal/catalog and internal/apiv2 tests pass. The DB-backed TestResolveVideoWithEpisodesSearch also passes against a freshly migrated PostgreSQL database; it was not run when the PR opened. make lint-changed is clean. CI passed on 85f20af.

Scores

  • Fit 8: it closes a real gap in core search, where "All" without books couldn't find episodes. It also adds a capability flag so older clients and servers keep working. It adds one enum value and one flag to the API, which is the cost.
  • Readiness 7: the approach is sound and the verified defect is fixed. CI passed on the new head. The open people-scope decision is what holds it below ready.

Review by Claude Code (claude-opus-5-5), with a read-only cross-check by Codex (gpt-6.1-sol). Fix commit by Claude Code.

@macroscopeapp

macroscopeapp Bot commented Oct 7, 2026

Copy link
Copy Markdown

The evidence link covers people search and no-query browse, but the new scope also changes the filter values returned by these endpoints:

  • getCatalogFilters (internal/apiv2/catalog_items.go): please add before-and-after responses for the same request, showing that the new scope narrows the options to video items.
  • searchCatalogFacet (internal/apiv2/catalog_items.go): please add before-and-after responses for the same facet query, showing the resulting matches are narrowed to video items.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@macroscopeapp

macroscopeapp Bot commented Oct 7, 2026

Copy link
Copy Markdown

One additional passed result is affected: silo-apple#308 C6 (Apple TV). It checks the preceding navigation with the TV remote, including search. Apple #630 uses the shared tvOS SearchViewModel; with this server capability, Search All can add episode cards and a different series/episode destination context. Those new focus targets mean the prior C6 pass does not establish remote reachability and Back behavior for the expanded results. Please explain this change to the validated remote flow and revalidate C6 after merge.

Suggested Validation tasks: line:

Validation tasks: changes Silo-Server/silo-apple#307 C3; changes Silo-Server/silo-apple#308 C3; changes Silo-Server/silo-apple#308 C6; changes Silo-Server/silo-apple#337 C1; changes Silo-Server/silo-apple#338 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@Quick104
Quick104 merged commit 47389e4 into Silo-Server:main Oct 8, 2026
22 checks passed
Quick104 added a commit that referenced this pull request Oct 8, 2026
Conflict resolution: main's video_with_episodes search scope (#1995) and
this branch's facet value search each added a flag to the catalog search
capabilities; both are kept, and the OpenAPI document, fixtures, and web
types are regenerated.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.

2 participants