Remove Indexers from App when Removed in Prowlarr

This commit is contained in:
Qstick
2021-02-17 21:51:28 -05:00
parent 546bec3717
commit 79c96b86a4
9 changed files with 50 additions and 8 deletions

View File

@@ -47,8 +47,16 @@ namespace NzbDrone.Core.Applications.Readarr
public override void RemoveIndexer(int indexerId)
{
//Use the Id mapping here to delete the correct indexer
throw new System.NotImplementedException();
var appMappings = _appIndexerMapService.GetMappingsForApp(Definition.Id);
var indexerMapping = appMappings.FirstOrDefault(m => m.IndexerId == indexerId);
if (indexerMapping != null)
{
//Remove Indexer remotely and then remove the mapping
_readarrV1Proxy.RemoveIndexer(indexerMapping.RemoteIndexerId, Settings);
_appIndexerMapService.Delete(indexerMapping.Id);
}
}
public override void UpdateIndexer(IndexerDefinition indexer)