From 4123745a6b3614ac1150b369b59b7de5c6484e06 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 8 Nov 2019 09:12:42 -0800 Subject: [PATCH] Fixed: Interactive search results failing to show when processing failed Closes #3377 --- .../DecisionEngine/DownloadDecisionMaker.cs | 23 +++++++++++++++---- src/Sonarr.Api.V3/Indexers/ReleaseModule.cs | 6 ++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index 368eb6b23..286fac520 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -114,14 +114,27 @@ namespace NzbDrone.Core.DecisionEngine } } - if (parsedEpisodeInfo == null || parsedEpisodeInfo.SeriesTitle.IsNullOrWhiteSpace() && searchCriteria != null) + if (searchCriteria != null) { - var remoteEpisode = new RemoteEpisode + if (parsedEpisodeInfo == null) { - Release = report - }; + parsedEpisodeInfo = new ParsedEpisodeInfo + { + Language = LanguageParser.ParseLanguage(report.Title), + Quality = QualityParser.ParseQuality(report.Title) + }; + } + + if (parsedEpisodeInfo.SeriesTitle.IsNullOrWhiteSpace()) + { + var remoteEpisode = new RemoteEpisode + { + Release = report, + ParsedEpisodeInfo = parsedEpisodeInfo + }; - decision = new DownloadDecision(remoteEpisode, new Rejection("Unable to parse release")); + decision = new DownloadDecision(remoteEpisode, new Rejection("Unable to parse release")); + } } } catch (Exception e) diff --git a/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs b/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs index 2903cd845..8a7e2ca19 100644 --- a/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs +++ b/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs @@ -163,9 +163,8 @@ namespace Sonarr.Api.V3.Indexers catch (Exception ex) { _logger.Error(ex, "Episode search failed: " + ex.Message); + throw new NzbDroneClientException(HttpStatusCode.InternalServerError, ex.Message); } - - return new List(); } private List GetSeasonReleases(int seriesId, int seasonNumber) @@ -184,9 +183,8 @@ namespace Sonarr.Api.V3.Indexers catch (Exception ex) { _logger.Error(ex, "Season search failed: " + ex.Message); + throw new NzbDroneClientException(HttpStatusCode.InternalServerError, ex.Message); } - - return new List(); } private List GetRss()