mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
Notifications wired up server sided
This commit is contained in:
parent
3f44339381
commit
e9bf78a97d
57 changed files with 977 additions and 951 deletions
31
NzbDrone.Core/Notifications/NotificationRepository.cs
Normal file
31
NzbDrone.Core/Notifications/NotificationRepository.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
|
||||
namespace NzbDrone.Core.Notifications
|
||||
{
|
||||
public interface INotificationRepository : IBasicRepository<NotificationDefinition>
|
||||
{
|
||||
NotificationDefinition Get(string name);
|
||||
NotificationDefinition Find(string name);
|
||||
}
|
||||
|
||||
public class NotificationRepository : BasicRepository<NotificationDefinition>, INotificationRepository
|
||||
{
|
||||
public NotificationRepository(IDatabase database, IMessageAggregator messageAggregator)
|
||||
: base(database, messageAggregator)
|
||||
{
|
||||
}
|
||||
|
||||
public NotificationDefinition Get(string name)
|
||||
{
|
||||
return Query.Single(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
|
||||
public NotificationDefinition Find(string name)
|
||||
{
|
||||
return Query.SingleOrDefault(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue