Fixed: (Cardigann) Allow use of template variables in fields selector

This commit is contained in:
Bogdan
2022-12-29 20:24:46 +02:00
committed by Qstick
parent a58380031d
commit c15643be39

View File

@@ -132,20 +132,22 @@ namespace NzbDrone.Core.Indexers.Cardigann
if (selector.Selector != null) if (selector.Selector != null)
{ {
if (dom.Matches(selector.Selector)) var selectorSelector = ApplyGoTemplateText(selector.Selector, variables);
if (dom.Matches(selectorSelector))
{ {
selection = dom; selection = dom;
} }
else else
{ {
selection = QuerySelector(dom, selector.Selector); selection = QuerySelector(dom, selectorSelector);
} }
if (selection == null) if (selection == null)
{ {
if (required) if (required)
{ {
throw new Exception(string.Format("Selector \"{0}\" didn't match {1}", selector.Selector, dom.ToHtmlPretty())); throw new Exception(string.Format("Selector \"{0}\" didn't match {1}", selectorSelector, dom.ToHtmlPretty()));
} }
return null; return null;