mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Sync Indexers on App Edit
This commit is contained in:
@@ -17,6 +17,7 @@ namespace NzbDrone.Core.Applications
|
||||
IHandleAsync<ProviderDeletedEvent<IIndexer>>,
|
||||
IHandleAsync<ProviderAddedEvent<IApplication>>,
|
||||
IHandleAsync<ProviderUpdatedEvent<IIndexer>>,
|
||||
IHandleAsync<ProviderUpdatedEvent<IApplication>>,
|
||||
IHandleAsync<ProviderBulkUpdatedEvent<IIndexer>>,
|
||||
IHandleAsync<ApiKeyChangedEvent>,
|
||||
IExecute<ApplicationIndexerSyncCommand>
|
||||
@@ -49,6 +50,19 @@ namespace NzbDrone.Core.Applications
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAsync(ProviderUpdatedEvent<IApplication> message)
|
||||
{
|
||||
var appDefinition = (ApplicationDefinition)message.Definition;
|
||||
|
||||
if (appDefinition.Enable)
|
||||
{
|
||||
var app = _applicationsFactory.GetInstance(appDefinition);
|
||||
var indexers = _indexerFactory.Enabled().Select(i => (IndexerDefinition)i.Definition).ToList();
|
||||
|
||||
SyncIndexers(new List<IApplication> { app }, indexers);
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAsync(ProviderAddedEvent<IIndexer> message)
|
||||
{
|
||||
var enabledApps = _applicationsFactory.SyncEnabled();
|
||||
|
Reference in New Issue
Block a user