namespace Cleanuparr.Infrastructure.Features.Notifications; public class NotificationFactory : INotificationFactory { private readonly IEnumerable _providers; public NotificationFactory(IEnumerable providers) { _providers = providers; } protected List ActiveProviders() => _providers .Where(x => x.Config.IsValid()) .Where(provider => provider.Config.IsEnabled) .ToList(); public List OnFailedImportStrikeEnabled() => ActiveProviders() .Where(n => n.Config.OnFailedImportStrike) .ToList(); public List OnStalledStrikeEnabled() => ActiveProviders() .Where(n => n.Config.OnStalledStrike) .ToList(); public List OnSlowStrikeEnabled() => ActiveProviders() .Where(n => n.Config.OnSlowStrike) .ToList(); public List OnQueueItemDeletedEnabled() => ActiveProviders() .Where(n => n.Config.OnQueueItemDeleted) .ToList(); public List OnDownloadCleanedEnabled() => ActiveProviders() .Where(n => n.Config.OnDownloadCleaned) .ToList(); public List OnCategoryChangedEnabled() => ActiveProviders() .Where(n => n.Config.OnCategoryChanged) .ToList(); }