Skip to content

feat: add multi-season pack auto-import support#8508

Draft
Nikamura wants to merge 1 commit intoSonarr:v5-developfrom
Nikamura:feat/multi-season-pack-support
Draft

feat: add multi-season pack auto-import support#8508
Nikamura wants to merge 1 commit intoSonarr:v5-developfrom
Nikamura:feat/multi-season-pack-support

Conversation

@Nikamura
Copy link
Copy Markdown

@Nikamura Nikamura commented Apr 4, 2026

Description

Enables auto-import of manually downloaded multi-season packs. Sonarr detected multi-season releases but refused to auto-import them, requiring manual import. This adds episode resolution for all seasons in a multi-season pack and removes the auto-import block. Multi-season packs remain blocked at the search/grab decision level.

@Nikamura Nikamura marked this pull request as ready for review April 4, 2026 08:43
@mynameisbogdan
Copy link
Copy Markdown
Contributor

How do you plan to deal with quality upgrades considering the possibility of every season having a different quality and different custom format scoring, increasing the chances for a download loop?

@Nikamura
Copy link
Copy Markdown
Author

Nikamura commented Apr 4, 2026

download loop?

How would we end up in the download loop ? If user has S01 and we find pack with S01 and S02. We would import S02 and S01 only be imported if new download was an upgrade. So next time pack would be ignored as it didn't include anything needed.

Or do you mean that we would still download S01 even when we wouldn't be importing it? But that's kinda the case at the moment where we download full pack, but only import S01.

@mynameisbogdan
Copy link
Copy Markdown
Contributor

@Nikamura
Copy link
Copy Markdown
Author

Nikamura commented Apr 5, 2026

I don't think my PR introduces new loop. PR doesn't change the grab side quality evaluation logic, it only unblocks the episode resolution and import paths that were previously hard rejected.

@mynameisbogdan
Copy link
Copy Markdown
Contributor

I don't think my PR introduces new loop. PR doesn't change the grab side quality evaluation logic, it only unblocks the episode resolution and import paths that were previously hard rejected.

It does. ATM multi-season packs are being blocked at search decision level, but you literally removed that specification in this PR.

Let's take How I Met Your LLM S01-S09 Complete 1080p WEB-DL Bluray H264 DDP5 1-Mixed for example (which contains only a season of bluray and 8 seasons web-dl), the quality is being parsed as Bluray-1080p but imported seasons with the quality WEB-DL 1080p will see this pack in future RSS syncs or searches as an eligible upgrade, thus resulting in a download loop.

Sonarr already parsed multi-season releases (e.g. S01-S09) but
discarded all season numbers except the first and hard-rejected
them during import. This change preserves all parsed season numbers
through the pipeline and resolves episodes for all seasons, enabling
auto-import of manually downloaded multi-season packs.

- Add SeasonNumbers array to ParsedEpisodeInfo and populate with
  expanded range in the parser (discrete seasons kept as-is)
- Add MultiSeasonPack (4) to the ReleaseType enum
- Extend ParsingService.GetEpisodes() to fetch episodes for all
  seasons with per-season scene mapping lookup
- Remove multi-season import rejection in DownloadedEpisodesImportService
- Remove multi-season import-blocked handling in CompletedDownloadService
- Derive V5 Queue SeasonNumbers from actual episode data
@Nikamura Nikamura force-pushed the feat/multi-season-pack-support branch from bae0550 to 18d7a4f Compare April 5, 2026 13:39
@Nikamura Nikamura changed the title feat: add multi-season pack support feat: add multi-season pack auto-import support Apr 5, 2026
@Nikamura
Copy link
Copy Markdown
Author

Nikamura commented Apr 5, 2026

It does.

I have updated the PR to exclude those changes. Current ones are just for auto importing manually added ones.

I could also add configurable option for auto importing multi seasons.

@markus101
Copy link
Copy Markdown
Member

Your PR description needs to follow the PR template, not the summary from AI.

SeriesId = model.Series?.Id,
EpisodeIds = model.Episodes?.Select(e => e.Id).ToList() ?? [],
SeasonNumbers = model.SeasonNumber.HasValue ? [model.SeasonNumber.Value] : [],
SeasonNumbers = model.Episodes?.Select(e => e.SeasonNumber).Distinct().OrderBy(s => s).ToList() is { Count: > 0 } seasonNumbers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The model should store the season numbers, not a single season number.

}
else
{
// Discrete seasons explicitly named (e.g., S01 S03 S05), keep as-is
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we even support season packs that aren't sequential? If we parse 1, 3, 5 then we should just fail to parse instead of trying to process.

{
episodeString = string.Format("{0}", AirDate);
}
else if (FullSeason && IsMultiSeason && SeasonNumbers.Length > 1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will we ever have IsMultiSeason when FullSeason is false?

if (FullSeason)
{
return Model.ReleaseType.SeasonPack;
return IsMultiSeason ? Model.ReleaseType.MultiSeasonPack : Model.ReleaseType.SeasonPack;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Related to my previous question, if the answer is no, then IsMultiSeason could be handled outside of this if block.

EpisodeNumbers = Array.Empty<int>();
AbsoluteEpisodeNumbers = Array.Empty<int>();
SpecialAbsoluteEpisodeNumbers = Array.Empty<decimal>();
SeasonNumbers = Array.Empty<int>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going to get confusing with SeasonNumber and SeasonNumbers.

If we want to keep SeasonNumber to limit the number of changes then we should make SeasonNumber return the first entry from SeasonNumbers instead.

Similarly, should IsMultiSeason be => SeasonNumbers.Count > 1?

@markus101 markus101 marked this pull request as draft April 16, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants