mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: (Cardigann) Parse text templates only if necessary
This commit is contained in:
@@ -349,11 +349,13 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
|
||||
public string ApplyGoTemplateText(string template, Dictionary<string, object> variables = null, TemplateTextModifier modifier = null)
|
||||
{
|
||||
if (variables == null)
|
||||
if (template.IsNullOrWhiteSpace() || !template.Contains("{{"))
|
||||
{
|
||||
variables = GetBaseTemplateVariables();
|
||||
return template;
|
||||
}
|
||||
|
||||
variables ??= GetBaseTemplateVariables();
|
||||
|
||||
// handle re_replace expression
|
||||
// Example: {{ re_replace .Query.Keywords "[^a-zA-Z0-9]+" "%" }}
|
||||
var reReplaceRegex = new Regex(@"{{\s*re_replace\s+(\..+?)\s+""(.*?)""\s+""(.*?)""\s*}}");
|
||||
|
Reference in New Issue
Block a user