diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs index 0bd470522..0976a9087 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannBase.cs @@ -375,6 +375,22 @@ namespace NzbDrone.Core.Indexers.Cardigann return results; } + public ICollection MapTrackerCatDescToNewznab(string trackerCategoryDesc) + { + if (string.IsNullOrWhiteSpace(trackerCategoryDesc)) + { + return new List(); + } + + var cats = _categoryMapping + .Where(m => + !string.IsNullOrWhiteSpace(m.TrackerCategoryDesc) && + string.Equals(m.TrackerCategoryDesc, trackerCategoryDesc, StringComparison.InvariantCultureIgnoreCase)) + .Select(c => NewznabStandardCategory.AllCats.FirstOrDefault(n => n.Id == c.NewzNabCategory) ?? new IndexerCategory { Id = c.NewzNabCategory }) + .ToList(); + return cats; + } + protected delegate string TemplateTextModifier(string str); protected string ApplyGoTemplateText(string template, Dictionary variables = null, TemplateTextModifier modifier = null)