Fix native search container expansion - #220
Merged
Nikorag merged 4 commits intoApr 22, 2026
Merged
Conversation
Expand episode results when native search hits series or brand containers so Sonarr receives episode-level results instead of container-only matches. Made-with: Cursor
Contributor
Author
|
Linking related bug report: #219 I checked this issue and it looks to be the same native-search container expansion path this PR fixes. |
StormPooper
requested changes
Mar 24, 2026
| } | ||
| } | ||
|
|
||
| async #expandEpisodesFromContainer(containerPid: string): Promise<IPlayerEpisodeMetadata[]> { |
| episodes.push(...seriesList.filter(({ type, release_date_time }) => type == 'episode' && release_date_time != null)); | ||
|
|
||
| const searchHitMetadata = await iplayerDetailsService.getMetadata(ref); | ||
| const fallbackContainerPid = searchHitMetadata.programme.type == 'series' || searchHitMetadata.programme.type == 'brand' |
Collaborator
There was a problem hiding this comment.
Existing tests failing, missing programme - might be this bit here. Either way, existing tests need updating.
- Mock iPlayer metadata programme.type for native search tests to match new getMetadata usage. - Add coverage for container fallback expansion when brand PID lookup fails. - Add coverage for nested container episode expansion and PID deduping.
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.
Summary
Verification
Smiley's People(S0E1..S0E6)The Mrs Merton Showstill returns expanded episode results under native searchnpm run build:backend)Context
This addresses cases where native search returns container-level matches but fails to expand to episode-level items needed by Sonarr.