From 9e45b9e80836ec21b815ee6bde592119b5222a46 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 10 Jun 2019 21:31:43 -0700 Subject: [PATCH] Fixed: Selecting a release from Interactive Search with an unknown episode --- src/Sonarr.Api.V3/Indexers/ReleaseModule.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs b/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs index a0d803c77..227035c98 100644 --- a/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs +++ b/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs @@ -100,9 +100,27 @@ namespace Sonarr.Api.V3.Indexers } else { - throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to find matching series and episodes"); + throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to find matching series and episodes"); } } + else if (remoteEpisode.Episodes.Empty()) + { + var episodes = _parsingService.GetEpisodes(remoteEpisode.ParsedEpisodeInfo, remoteEpisode.Series, true); + + if (episodes.Empty() && release.EpisodeId.HasValue) + { + var episode = _episodeService.GetEpisode(release.EpisodeId.Value); + + episodes = new List{episode}; + } + + remoteEpisode.Episodes = episodes; + } + + if (remoteEpisode.Episodes.Empty()) + { + throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to parse episodes in the release"); + } _downloadService.DownloadReport(remoteEpisode); }