mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: (Cardigann) - Cardigann v4 Add Support for MapTrackerCatDescToNewznab
This commit is contained in:
@@ -375,6 +375,22 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICollection<IndexerCategory> MapTrackerCatDescToNewznab(string trackerCategoryDesc)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(trackerCategoryDesc))
|
||||||
|
{
|
||||||
|
return new List<IndexerCategory>();
|
||||||
|
}
|
||||||
|
|
||||||
|
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 delegate string TemplateTextModifier(string str);
|
||||||
|
|
||||||
protected string ApplyGoTemplateText(string template, Dictionary<string, object> variables = null, TemplateTextModifier modifier = null)
|
protected string ApplyGoTemplateText(string template, Dictionary<string, object> variables = null, TemplateTextModifier modifier = null)
|
||||||
|
Reference in New Issue
Block a user