mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
More Connects cleanup/fixing
This commit is contained in:
@@ -1,20 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Composition;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
||||
namespace NzbDrone.Core.Notifications
|
||||
{
|
||||
public interface INotificationFactory : IProviderFactory<INotification, NotificationDefinition>
|
||||
{
|
||||
|
||||
List<INotification> OnGrabEnabled();
|
||||
List<INotification> OnDownloadEnabled();
|
||||
}
|
||||
|
||||
public class NotificationFactory : ProviderFactory<INotification, NotificationDefinition>, INotificationFactory
|
||||
{
|
||||
public NotificationFactory(INotificationRepository providerRepository, IEnumerable<INotification> providers, Logger logger)
|
||||
: base(providerRepository, providers, logger)
|
||||
{
|
||||
private IEnumerable<INotification> _providers;
|
||||
|
||||
public NotificationFactory(INotificationRepository providerRepository, IEnumerable<INotification> providers, IContainer container, Logger logger)
|
||||
: base(providerRepository, providers, container, logger)
|
||||
{
|
||||
_providers = providers;
|
||||
}
|
||||
|
||||
public List<INotification> OnGrabEnabled()
|
||||
{
|
||||
return GetAvailableProviders().Where(n => ((NotificationDefinition)n.Definition).OnGrab).ToList();
|
||||
}
|
||||
|
||||
public List<INotification> OnDownloadEnabled()
|
||||
{
|
||||
return GetAvailableProviders().Where(n => ((NotificationDefinition)n.Definition).OnDownload).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user