1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

New: Show Custom Formats on Manual Import / Manage Episodes

Closes #5241
This commit is contained in:
Mark McDowall
2022-12-03 17:16:08 -08:00
committed by Mark McDowall
parent 6216a71f8c
commit da4f6b7df9
8 changed files with 82 additions and 2 deletions
@@ -18,6 +18,7 @@ namespace NzbDrone.Core.CustomFormats
List<CustomFormat> ParseCustomFormat(EpisodeFile episodeFile);
List<CustomFormat> ParseCustomFormat(Blocklist blocklist, Series series);
List<CustomFormat> ParseCustomFormat(EpisodeHistory history, Series series);
List<CustomFormat> ParseCustomFormat(LocalEpisode localEpisode);
}
public class CustomFormatCalculationService : ICustomFormatCalculationService
@@ -102,6 +103,28 @@ namespace NzbDrone.Core.CustomFormats
return ParseCustomFormat(input);
}
public List<CustomFormat> ParseCustomFormat(LocalEpisode localEpisode)
{
var episodeInfo = new ParsedEpisodeInfo
{
SeriesTitle = localEpisode.Series.Title,
ReleaseTitle = localEpisode.SceneName,
Quality = localEpisode.Quality,
Languages = localEpisode.Languages,
ReleaseGroup = localEpisode.ReleaseGroup
};
var input = new CustomFormatInput
{
EpisodeInfo = episodeInfo,
Series = localEpisode.Series,
Size = localEpisode.Size,
Languages = localEpisode.Languages
};
return ParseCustomFormat(input);
}
private List<CustomFormat> ParseCustomFormat(CustomFormatInput input)
{
return ParseCustomFormat(input, _formatService.All());
@@ -148,7 +171,7 @@ namespace NzbDrone.Core.CustomFormats
var episodeInfo = new ParsedEpisodeInfo
{
SeriesTitle = episodeFile.Series.Value.Title,
SeriesTitle = series.Title,
ReleaseTitle = sceneName,
Quality = episodeFile.Quality,
Languages = episodeFile.Languages,