mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-25 09:54:11 +01:00
Fixed: (Cardigann) Allow use of template variables in fields selector
This commit is contained in:
parent
a58380031d
commit
c15643be39
1 changed files with 5 additions and 3 deletions
|
|
@ -132,20 +132,22 @@ protected string HandleSelector(SelectorBlock selector, IElement dom, Dictionary
|
|||
|
||||
if (selector.Selector != null)
|
||||
{
|
||||
if (dom.Matches(selector.Selector))
|
||||
var selectorSelector = ApplyGoTemplateText(selector.Selector, variables);
|
||||
|
||||
if (dom.Matches(selectorSelector))
|
||||
{
|
||||
selection = dom;
|
||||
}
|
||||
else
|
||||
{
|
||||
selection = QuerySelector(dom, selector.Selector);
|
||||
selection = QuerySelector(dom, selectorSelector);
|
||||
}
|
||||
|
||||
if (selection == null)
|
||||
{
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue