From dfe132cda24b2b532955bccf7853cb4bbe90de64 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 18 Dec 2022 21:46:14 -0600 Subject: [PATCH] Fixed: Retain direct Indexer properties not affiliated with Prowlarr Fixes #1165 --- src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs | 5 ++++- src/NzbDrone.Core/Applications/Lidarr/LidarrIndexer.cs | 1 + src/NzbDrone.Core/Applications/Radarr/Radarr.cs | 5 ++++- src/NzbDrone.Core/Applications/Radarr/RadarrIndexer.cs | 1 + src/NzbDrone.Core/Applications/Readarr/Readarr.cs | 1 - src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs | 7 ++++++- src/NzbDrone.Core/Applications/Sonarr/SonarrIndexer.cs | 2 ++ src/NzbDrone.Core/Applications/Whisparr/Whisparr.cs | 1 - 8 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs b/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs index f05e0e40c..cafdeaf60 100644 --- a/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs +++ b/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs @@ -7,7 +7,6 @@ using Newtonsoft.Json.Linq; using NLog; using NzbDrone.Common.Cache; using NzbDrone.Common.Extensions; -using NzbDrone.Core.Applications.Whisparr; using NzbDrone.Core.Configuration; using NzbDrone.Core.Indexers; @@ -127,8 +126,12 @@ namespace NzbDrone.Core.Applications.Lidarr { if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) { + // Retain user fields not-affiliated with Prowlarr lidarrIndexer.Fields.AddRange(remoteIndexer.Fields.Where(f => !lidarrIndexer.Fields.Any(s => s.Name == f.Name))); + // Retain user settings not-affiliated with Prowlarr + lidarrIndexer.DownloadClientId = remoteIndexer.DownloadClientId; + // Update the indexer if it still has categories that match _lidarrV1Proxy.UpdateIndexer(lidarrIndexer, Settings); } diff --git a/src/NzbDrone.Core/Applications/Lidarr/LidarrIndexer.cs b/src/NzbDrone.Core/Applications/Lidarr/LidarrIndexer.cs index 2171e1ba9..7ac02fd45 100644 --- a/src/NzbDrone.Core/Applications/Lidarr/LidarrIndexer.cs +++ b/src/NzbDrone.Core/Applications/Lidarr/LidarrIndexer.cs @@ -17,6 +17,7 @@ namespace NzbDrone.Core.Applications.Lidarr public string Implementation { get; set; } public string ConfigContract { get; set; } public string InfoLink { get; set; } + public int? DownloadClientId { get; set; } public HashSet Tags { get; set; } public List Fields { get; set; } diff --git a/src/NzbDrone.Core/Applications/Radarr/Radarr.cs b/src/NzbDrone.Core/Applications/Radarr/Radarr.cs index 7faaeb663..f55cb83eb 100644 --- a/src/NzbDrone.Core/Applications/Radarr/Radarr.cs +++ b/src/NzbDrone.Core/Applications/Radarr/Radarr.cs @@ -7,7 +7,6 @@ using Newtonsoft.Json.Linq; using NLog; using NzbDrone.Common.Cache; using NzbDrone.Common.Extensions; -using NzbDrone.Core.Applications.Whisparr; using NzbDrone.Core.Configuration; using NzbDrone.Core.Indexers; @@ -127,8 +126,12 @@ namespace NzbDrone.Core.Applications.Radarr { if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) { + // Retain user fields not-affiliated with Prowlarr radarrIndexer.Fields.AddRange(remoteIndexer.Fields.Where(f => !radarrIndexer.Fields.Any(s => s.Name == f.Name))); + // Retain user settings not-affiliated with Prowlarr + radarrIndexer.DownloadClientId = remoteIndexer.DownloadClientId; + // Update the indexer if it still has categories that match _radarrV3Proxy.UpdateIndexer(radarrIndexer, Settings); } diff --git a/src/NzbDrone.Core/Applications/Radarr/RadarrIndexer.cs b/src/NzbDrone.Core/Applications/Radarr/RadarrIndexer.cs index 25f11b1c0..38082724e 100644 --- a/src/NzbDrone.Core/Applications/Radarr/RadarrIndexer.cs +++ b/src/NzbDrone.Core/Applications/Radarr/RadarrIndexer.cs @@ -17,6 +17,7 @@ namespace NzbDrone.Core.Applications.Radarr public string Implementation { get; set; } public string ConfigContract { get; set; } public string InfoLink { get; set; } + public int? DownloadClientId { get; set; } public HashSet Tags { get; set; } public List Fields { get; set; } diff --git a/src/NzbDrone.Core/Applications/Readarr/Readarr.cs b/src/NzbDrone.Core/Applications/Readarr/Readarr.cs index 0a00524a9..324d6c9ab 100644 --- a/src/NzbDrone.Core/Applications/Readarr/Readarr.cs +++ b/src/NzbDrone.Core/Applications/Readarr/Readarr.cs @@ -7,7 +7,6 @@ using Newtonsoft.Json.Linq; using NLog; using NzbDrone.Common.Cache; using NzbDrone.Common.Extensions; -using NzbDrone.Core.Applications.Whisparr; using NzbDrone.Core.Configuration; using NzbDrone.Core.Indexers; diff --git a/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs b/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs index 032606f00..3584a8734 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/Sonarr.cs @@ -126,9 +126,14 @@ namespace NzbDrone.Core.Applications.Sonarr { if (indexer.Capabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any() || indexer.Capabilities.Categories.SupportedCategories(Settings.AnimeSyncCategories.ToArray()).Any()) { - // Update the indexer if it still has categories that match + // Retain user fields not-affiliated with Prowlarr sonarrIndexer.Fields.AddRange(remoteIndexer.Fields.Where(f => !sonarrIndexer.Fields.Any(s => s.Name == f.Name))); + // Retain user settings not-affiliated with Prowlarr + sonarrIndexer.DownloadClientId = remoteIndexer.DownloadClientId; + sonarrIndexer.SeasonSearchMaximumSingleEpisodeAge = remoteIndexer.SeasonSearchMaximumSingleEpisodeAge; + + // Update the indexer if it still has categories that match _sonarrV3Proxy.UpdateIndexer(sonarrIndexer, Settings); } else diff --git a/src/NzbDrone.Core/Applications/Sonarr/SonarrIndexer.cs b/src/NzbDrone.Core/Applications/Sonarr/SonarrIndexer.cs index a2fd4b944..e3dffaed0 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/SonarrIndexer.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/SonarrIndexer.cs @@ -17,6 +17,8 @@ namespace NzbDrone.Core.Applications.Sonarr public string Implementation { get; set; } public string ConfigContract { get; set; } public string InfoLink { get; set; } + public int? DownloadClientId { get; set; } + public int? SeasonSearchMaximumSingleEpisodeAge { get; set; } public HashSet Tags { get; set; } public List Fields { get; set; } diff --git a/src/NzbDrone.Core/Applications/Whisparr/Whisparr.cs b/src/NzbDrone.Core/Applications/Whisparr/Whisparr.cs index cc2ad5d61..11464ed2e 100644 --- a/src/NzbDrone.Core/Applications/Whisparr/Whisparr.cs +++ b/src/NzbDrone.Core/Applications/Whisparr/Whisparr.cs @@ -7,7 +7,6 @@ using Newtonsoft.Json.Linq; using NLog; using NzbDrone.Common.Cache; using NzbDrone.Common.Extensions; -using NzbDrone.Core.Applications.Sonarr; using NzbDrone.Core.Configuration; using NzbDrone.Core.Indexers;