mirror of https://github.com/lidarr/Lidarr
27 lines
886 B
C#
27 lines
886 B
C#
![]() |
using NzbDrone.Core.Messaging.Commands;
|
||
|
using NzbDrone.Core.Messaging.Events;
|
||
|
using NzbDrone.Core.ThingiProvider.Events;
|
||
|
|
||
|
namespace NzbDrone.Core.ImportLists
|
||
|
{
|
||
|
public class ImportListUpdatedHandler : IHandle<ProviderUpdatedEvent<IImportList>>, IHandle<ProviderAddedEvent<IImportList>>
|
||
|
{
|
||
|
private readonly IManageCommandQueue _commandQueueManager;
|
||
|
|
||
|
public ImportListUpdatedHandler(IManageCommandQueue commandQueueManager)
|
||
|
{
|
||
|
_commandQueueManager = commandQueueManager;
|
||
|
}
|
||
|
|
||
|
public void Handle(ProviderUpdatedEvent<IImportList> message)
|
||
|
{
|
||
|
_commandQueueManager.Push(new ImportListSyncCommand(message.Definition.Id));
|
||
|
}
|
||
|
|
||
|
public void Handle(ProviderAddedEvent<IImportList> message)
|
||
|
{
|
||
|
_commandQueueManager.Push(new ImportListSyncCommand(message.Definition.Id));
|
||
|
}
|
||
|
}
|
||
|
}
|