Fixed: Remove Indexer if categories were changed to not include in sync

Applies to Full Sync Update

Fixes #912
This commit is contained in:
Qstick
2022-04-16 15:32:37 -05:00
parent cf01c52c34
commit 302ed91d05
6 changed files with 146 additions and 9 deletions

View File

@@ -124,7 +124,17 @@ namespace NzbDrone.Core.Applications.Sonarr
if (!sonarrIndexer.Equals(remoteIndexer))
{
_sonarrV3Proxy.UpdateIndexer(sonarrIndexer, Settings);
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
_sonarrV3Proxy.UpdateIndexer(sonarrIndexer, Settings);
}
else
{
// Else remove it, it no longer should be used
_sonarrV3Proxy.RemoveIndexer(remoteIndexer.Id, Settings);
_appIndexerMapService.Delete(indexerMapping.Id);
}
}
}
else