core: cardigann json no results enhancement #13223

This commit is contained in:
Garfield69 2022-05-05 06:11:08 +12:00
parent a74d1fc31c
commit 4f7644b692
1 changed files with 4 additions and 1 deletions

View File

@ -1399,7 +1399,10 @@ namespace Jackett.Common.Indexers
{
if (response.Status != HttpStatusCode.OK)
throw new Exception($"Error Parsing Json Response: Status={response.Status} Response={results}");
if (response.Status == HttpStatusCode.OK && SearchPath.Response != null && SearchPath.Response.NoResultsMessage != null && ((SearchPath.Response.NoResultsMessage.Equals(results)) || (SearchPath.Response.NoResultsMessage == String.Empty && results == String.Empty)))
if (response.Status == HttpStatusCode.OK
&& SearchPath.Response != null
&& SearchPath.Response.NoResultsMessage != null
&& (results.Contains(SearchPath.Response.NoResultsMessage) || (SearchPath.Response.NoResultsMessage == String.Empty && results == String.Empty)))
continue;
var parsedJson = JToken.Parse(results);
if (parsedJson == null)