Fixed: (Cardigann) Change UseBeforeResponse to Usebeforeresponse

pull/1467/head v1.3.0.2757
Bogdan 2 years ago
parent b85679de56
commit 6ec761c217

@ -190,14 +190,14 @@ namespace NzbDrone.Core.Indexers.Cardigann
{
public SelectorField Hash { get; set; }
public SelectorField Title { get; set; }
public bool UseBeforeResponse { get; set; }
public bool Usebeforeresponse { get; set; }
}
public class SelectorField
{
public string Selector { get; set; }
public string Attribute { get; set; }
public bool UseBeforeResponse { get; set; }
public bool Usebeforeresponse { get; set; }
public List<FilterBlock> Filters { get; set; }
}

@ -712,8 +712,6 @@ namespace NzbDrone.Core.Indexers.Cardigann
{
var requestLinkStr = ResolvePath(ApplyGoTemplateText(request.Path, variables)).ToString();
_logger.Debug("CardigannIndexer ({0}): handleRequest() requestLinkStr= {1}", _definition.Id, requestLinkStr);
Dictionary<string, string> pairs = null;
var queryCollection = new NameValueCollection();
@ -771,9 +769,12 @@ namespace NzbDrone.Core.Indexers.Cardigann
.WithRateLimit(_rateLimit.TotalSeconds)
.Build();
_logger.Debug("CardigannIndexer ({0}): handleRequest() httpRequest={1}", _definition.Id, httpRequest);
var response = await HttpClient.ExecuteProxiedAsync(httpRequest, Definition);
_logger.Debug("CardigannIndexer ({0}): handleRequest() remote server returned {1}", _definition.Id, response.StatusCode);
return response;
}
@ -822,7 +823,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
{
try
{
if (!download.Infohash.UseBeforeResponse || download.Before == null || response == null)
if (!download.Infohash.Usebeforeresponse || download.Before == null || response == null)
{
response = await HttpClient.ExecuteProxiedAsync(request, Definition);
}
@ -830,13 +831,13 @@ namespace NzbDrone.Core.Indexers.Cardigann
var hash = MatchSelector(response, download.Infohash.Hash, variables);
if (hash == null)
{
throw new CardigannException($"InfoHash selectors didn't match");
throw new CardigannException("InfoHash selectors didn't match hash.");
}
var title = MatchSelector(response, download.Infohash.Title, variables);
if (title == null)
{
throw new CardigannException($"InfoHash selectors didn't match");
throw new CardigannException("InfoHash selectors didn't match title.");
}
var magnet = MagnetLinkBuilder.BuildPublicMagnetLink(hash, title);
@ -868,7 +869,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
try
{
if (!selector.UseBeforeResponse || download.Before == null || response == null)
if (!selector.Usebeforeresponse || download.Before == null || response == null)
{
response = await HttpClient.ExecuteProxiedAsync(request, Definition);
}
@ -941,8 +942,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
var selectorText = ApplyGoTemplateText(selector.Selector, variables);
var parser = new HtmlParser();
var results = response.Content;
var resultDocument = parser.ParseDocument(results);
var resultDocument = parser.ParseDocument(response.Content);
var element = resultDocument.QuerySelector(selectorText);
if (element == null)

Loading…
Cancel
Save