From c15643be399aa92e3766e1f3dd8d15cff99dfa2d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 29 Dec 2022 20:24:46 +0200 Subject: [PATCH] Fixed: (Cardigann) Allow use of template variables in fields selector --- .../Indexers/Definitions/Cardigann/CardigannBase.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs index e24d28aa6..0e3900295 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs @@ -132,20 +132,22 @@ namespace NzbDrone.Core.Indexers.Cardigann 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;