From ec8025c3dc2fb8896bf83a09c31505236d5f9df3 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 26 Feb 2023 16:41:02 -0600 Subject: [PATCH] New: (Cardigann) Add AllowEmptyInputs Co-Authored-By: Bogdan --- .../Indexers/Definitions/Cardigann/CardigannDefinition.cs | 1 + .../Definitions/Cardigann/CardigannRequestGenerator.cs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannDefinition.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannDefinition.cs index 737cce7ec..d098581df 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannDefinition.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannDefinition.cs @@ -144,6 +144,7 @@ namespace NzbDrone.Core.Indexers.Cardigann { public int PageSize { get; set; } public int FirstPageNumber { get; set; } + public bool AllowEmptyInputs { get; set; } public string Path { get; set; } public List Paths { get; set; } public Dictionary> Headers { get; set; } diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs index a49e91a44..65b4236da 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannRequestGenerator.cs @@ -1117,7 +1117,12 @@ namespace NzbDrone.Core.Indexers.Cardigann } else { - queryCollection.Add(input.Key, ApplyGoTemplateText(input.Value, variables)); + var inputValue = ApplyGoTemplateText(input.Value, variables); + + if (!string.IsNullOrWhiteSpace(inputValue) || search.AllowEmptyInputs) + { + queryCollection.Add(input.Key, inputValue); + } } } }