mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-05-08 12:43:19 +02:00
Fixed: Sync Indexers on App Edit
This commit is contained in:
parent
16f0486da2
commit
cf01c52c34
1 changed files with 14 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ public class ApplicationService : IHandleAsync<ProviderAddedEvent<IIndexer>>,
|
|||
IHandleAsync<ProviderDeletedEvent<IIndexer>>,
|
||||
IHandleAsync<ProviderAddedEvent<IApplication>>,
|
||||
IHandleAsync<ProviderUpdatedEvent<IIndexer>>,
|
||||
IHandleAsync<ProviderUpdatedEvent<IApplication>>,
|
||||
IHandleAsync<ProviderBulkUpdatedEvent<IIndexer>>,
|
||||
IHandleAsync<ApiKeyChangedEvent>,
|
||||
IExecute<ApplicationIndexerSyncCommand>
|
||||
|
|
@ -49,6 +50,19 @@ public void HandleAsync(ProviderAddedEvent<IApplication> message)
|
|||
}
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue