From 252b9a1b6b59b3949a000345c917e27aca52fc0b Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 14 Aug 2021 23:56:37 -0400 Subject: [PATCH] Fixed: (Sonarr) Correctly set anime categories --- src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs | 6 +++--- src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs b/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs index 9285d7498..589e8eb72 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs @@ -81,7 +81,7 @@ namespace NzbDrone.Core.Applications.Sonarr public override void AddIndexer(IndexerDefinition indexer) { - if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) + if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any() || indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray()).Any()) { var sonarrIndexer = BuildSonarrIndexer(indexer, indexer.Protocol); @@ -128,7 +128,7 @@ namespace NzbDrone.Core.Applications.Sonarr { _appIndexerMapService.Delete(indexerMapping.Id); - if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) + if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any() || indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray()).Any()) { _logger.Debug("Remote indexer not found, re-adding {0} to Sonarr", indexer.Name); sonarrIndexer.Id = 0; @@ -169,7 +169,7 @@ namespace NzbDrone.Core.Applications.Sonarr sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "apiPath").Value = "/api"; sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "apiKey").Value = _configFileProvider.ApiKey; sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "categories").Value = JArray.FromObject(indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray())); - sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "animeCategories").Value = JArray.FromObject(indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray())); + sonarrIndexer.Fields.FirstOrDefault(x => x.Name == "animeCategories").Value = JArray.FromObject(indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray())); return sonarrIndexer; } diff --git a/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs b/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs index eb12b7c6f..0ab030ca4 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/SonarrSettings.cs @@ -23,10 +23,12 @@ namespace NzbDrone.Core.Applications.Sonarr { ProwlarrUrl = "http://localhost:9696"; BaseUrl = "http://localhost:8989"; - SyncCategories = new[] { 5000, 5010, 5020, 5030, 5040, 5045, 5050, 5070 }; + SyncCategories = new[] { 5000, 5010, 5020, 5030, 5040, 5045, 5050 }; + AnimeSyncCategories = new[] { 5070 }; } public IEnumerable SyncCategories { get; set; } + public IEnumerable AnimeSyncCategories { get; set; } [FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as Sonarr sees it, including http(s)://, port, and urlbase if needed")] public string ProwlarrUrl { get; set; }