From 2451a9a9ee4deeaee517eb7987300e784cf898f7 Mon Sep 17 00:00:00 2001 From: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com> Date: Mon, 17 May 2021 22:12:16 +0100 Subject: [PATCH] New: Removal of indexers on application sync that are no longer defined within Prowlarr --- src/NzbDrone.Core/Applications/ApplicationService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/NzbDrone.Core/Applications/ApplicationService.cs b/src/NzbDrone.Core/Applications/ApplicationService.cs index 63665dfd7..dda51c258 100644 --- a/src/NzbDrone.Core/Applications/ApplicationService.cs +++ b/src/NzbDrone.Core/Applications/ApplicationService.cs @@ -147,6 +147,15 @@ namespace NzbDrone.Core.Applications } } } + + foreach (var mapping in indexerMappings) + { + if (!indexers.Any(x => x.Id == mapping.IndexerId)) + { + _logger.Info("Indexer with the ID {0} was found within {1} but is no longer defined within Prowlarr, this is being removed.", mapping.IndexerId, app.Name); + ExecuteAction(a => a.RemoveIndexer(mapping.IndexerId), app); + } + } } }