From 9c936121e86fb482591773dd65b5ae04510de1dd Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 22 May 2025 13:30:41 +0300 Subject: [PATCH] Fixed: Sync indexers with basic search to Lidarr and Readarr Fixes #2402 --- src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs | 10 ++++++---- src/NzbDrone.Core/Applications/Readarr/Readarr.cs | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs b/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs index 5802f0459..d305b48d2 100644 --- a/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs +++ b/src/NzbDrone.Core/Applications/Lidarr/Lidarr.cs @@ -121,9 +121,9 @@ public override void AddIndexer(IndexerDefinition indexer) { var indexerCapabilities = GetIndexerCapabilities(indexer); - if (!indexerCapabilities.MusicSearchAvailable) + if (!indexerCapabilities.MusicSearchAvailable && !indexerCapabilities.SearchAvailable) { - _logger.Debug("Skipping add for indexer {0} [{1}] due to missing music search support by the indexer", indexer.Name, indexer.Id); + _logger.Debug("Skipping add for indexer {0} [{1}] due to missing music or basic search support by the indexer", indexer.Name, indexer.Id); return; } @@ -185,7 +185,8 @@ public override void UpdateIndexer(IndexerDefinition indexer, bool forceSync = f { _logger.Debug("Syncing remote indexer with current settings"); - if (indexerCapabilities.MusicSearchAvailable && indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) + if ((indexerCapabilities.MusicSearchAvailable || indexerCapabilities.SearchAvailable) && + indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) { // Retain user fields not-affiliated with Prowlarr lidarrIndexer.Fields.AddRange(remoteIndexer.Fields.Where(f => lidarrIndexer.Fields.All(s => s.Name != f.Name))); @@ -211,7 +212,8 @@ public override void UpdateIndexer(IndexerDefinition indexer, bool forceSync = f { _appIndexerMapService.Delete(indexerMapping.Id); - if (indexerCapabilities.MusicSearchAvailable && indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) + if ((indexerCapabilities.MusicSearchAvailable || indexerCapabilities.SearchAvailable) && + indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) { _logger.Debug("Remote indexer not found, re-adding {0} [{1}] to Lidarr", indexer.Name, indexer.Id); lidarrIndexer.Id = 0; diff --git a/src/NzbDrone.Core/Applications/Readarr/Readarr.cs b/src/NzbDrone.Core/Applications/Readarr/Readarr.cs index c05e9e000..efcc1eca0 100644 --- a/src/NzbDrone.Core/Applications/Readarr/Readarr.cs +++ b/src/NzbDrone.Core/Applications/Readarr/Readarr.cs @@ -121,9 +121,9 @@ public override void AddIndexer(IndexerDefinition indexer) { var indexerCapabilities = GetIndexerCapabilities(indexer); - if (!indexerCapabilities.BookSearchAvailable) + if (!indexerCapabilities.BookSearchAvailable && !indexerCapabilities.SearchAvailable) { - _logger.Debug("Skipping add for indexer {0} [{1}] due to missing book search support by the indexer", indexer.Name, indexer.Id); + _logger.Debug("Skipping add for indexer {0} [{1}] due to missing book or basic search support by the indexer", indexer.Name, indexer.Id); return; } @@ -185,7 +185,8 @@ public override void UpdateIndexer(IndexerDefinition indexer, bool forceSync = f { _logger.Debug("Syncing remote indexer with current settings"); - if (indexerCapabilities.BookSearchAvailable && indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) + if ((indexerCapabilities.BookSearchAvailable || indexerCapabilities.SearchAvailable) && + indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) { // Retain user fields not-affiliated with Prowlarr readarrIndexer.Fields.AddRange(remoteIndexer.Fields.Where(f => readarrIndexer.Fields.All(s => s.Name != f.Name))); @@ -211,7 +212,8 @@ public override void UpdateIndexer(IndexerDefinition indexer, bool forceSync = f { _appIndexerMapService.Delete(indexerMapping.Id); - if (indexerCapabilities.BookSearchAvailable && indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) + if ((indexerCapabilities.BookSearchAvailable || indexerCapabilities.SearchAvailable) && + indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()).Any()) { _logger.Debug("Remote indexer not found, re-adding {0} [{1}] to Readarr", indexer.Name, indexer.Id); readarrIndexer.Id = 0;