feat: add multi-season pack auto-import support#8508
feat: add multi-season pack auto-import support#8508Nikamura wants to merge 1 commit intoSonarr:v5-developfrom
Conversation
|
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? |
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. |
|
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 |
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
bae0550 to
18d7a4f
Compare
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. |
|
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Will we ever have IsMultiSeason when FullSeason is false?
| if (FullSeason) | ||
| { | ||
| return Model.ReleaseType.SeasonPack; | ||
| return IsMultiSeason ? Model.ReleaseType.MultiSeasonPack : Model.ReleaseType.SeasonPack; |
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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?
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.