mirror of
https://github.com/Jackett/Jackett.git
synced 2025-10-02 08:34:32 +02:00
core: cardigann json: add NoResultsMessage to Search Paths Response block
some json servers in response to a query-not-found return a message string instead of a json object. so this is a way to avoid a json-object-no-found error and get a graceful no-results-found state.
This commit is contained in:
@@ -1383,6 +1383,8 @@ 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))
|
||||
continue;
|
||||
var parsedJson = JToken.Parse(results);
|
||||
if (parsedJson == null)
|
||||
throw new Exception("Error Parsing Json Response");
|
||||
|
@@ -201,6 +201,7 @@ namespace Jackett.Common.Models
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string Attribute { get; set; }
|
||||
public string NoResultsMessage { get; set; }
|
||||
public bool Multiple { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user