Fixed: Prevent exception when grabbing unparsable release

Closes #7494
interactive-search-unparsable-release
Mark McDowall 2 months ago
parent edfc12e27a
commit b1896b4c74
No known key found for this signature in database

@ -94,6 +94,11 @@ namespace NzbDrone.Core.DataAugmentation.Scene
public SceneMapping FindSceneMapping(string seriesTitle, string releaseTitle, int sceneSeasonNumber) public SceneMapping FindSceneMapping(string seriesTitle, string releaseTitle, int sceneSeasonNumber)
{ {
if (seriesTitle.IsNullOrWhiteSpace())
{
return null;
}
var mappings = FindMappings(seriesTitle, releaseTitle); var mappings = FindMappings(seriesTitle, releaseTitle);
if (mappings == null) if (mappings == null)

@ -836,6 +836,11 @@ namespace NzbDrone.Core.Parser
public static string CleanSeriesTitle(this string title) public static string CleanSeriesTitle(this string title)
{ {
if (title.IsNullOrWhiteSpace())
{
return title;
}
// If Title only contains numbers return it as is. // If Title only contains numbers return it as is.
if (long.TryParse(title, out _)) if (long.TryParse(title, out _))
{ {

@ -127,7 +127,7 @@ namespace Sonarr.Api.V3.Indexers
if (episodes.Empty()) if (episodes.Empty())
{ {
throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to parse episodes in the release"); throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to parse episodes in the release, will need to be manually provided");
} }
remoteEpisode.Series = series; remoteEpisode.Series = series;
@ -135,7 +135,7 @@ namespace Sonarr.Api.V3.Indexers
} }
else 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, will need to be manually provided");
} }
} }
else if (remoteEpisode.Episodes.Empty()) else if (remoteEpisode.Episodes.Empty())
@ -154,7 +154,7 @@ namespace Sonarr.Api.V3.Indexers
if (remoteEpisode.Episodes.Empty()) if (remoteEpisode.Episodes.Empty())
{ {
throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to parse episodes in the release"); throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to parse episodes in the release, will need to be manually provided");
} }
await _downloadService.DownloadReport(remoteEpisode, release.DownloadClientId); await _downloadService.DownloadReport(remoteEpisode, release.DownloadClientId);

Loading…
Cancel
Save