New: Sync Indexers with Mylar3

This commit is contained in:
Qstick
2021-08-13 17:25:20 -04:00
parent 09d839ffb1
commit 77892a3885
18 changed files with 553 additions and 21 deletions

View File

@@ -55,12 +55,12 @@ namespace NzbDrone.Core.Applications.Sonarr
return new ValidationResult(failures);
}
public override Dictionary<int, int> GetIndexerMappings()
public override List<AppIndexerMap> GetIndexerMappings()
{
var indexers = _sonarrV3Proxy.GetIndexers(Settings)
.Where(i => i.Implementation == "Newznab" || i.Implementation == "Torznab");
var mappings = new Dictionary<int, int>();
var mappings = new List<AppIndexerMap>();
foreach (var indexer in indexers)
{
@@ -71,7 +71,7 @@ namespace NzbDrone.Core.Applications.Sonarr
if (match.Groups["indexer"].Success && int.TryParse(match.Groups["indexer"].Value, out var indexerId))
{
//Add parsed mapping if it's mapped to a Indexer in this Prowlarr instance
mappings.Add(indexer.Id, indexerId);
mappings.Add(new AppIndexerMap { RemoteIndexerId = indexer.Id, IndexerId = indexerId });
}
}
}