mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Cleaned up per comments
This commit is contained in:
parent
4d101cc6dc
commit
af6e3ddb66
13 changed files with 41 additions and 36 deletions
|
@ -9,6 +9,7 @@ using NzbDrone.Common.Messaging;
|
|||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
using Omu.ValueInjecter;
|
||||
|
||||
namespace NzbDrone.Core.Notifications
|
||||
{
|
||||
|
@ -82,14 +83,9 @@ namespace NzbDrone.Core.Notifications
|
|||
|
||||
public Notification Create(Notification notification)
|
||||
{
|
||||
var definition = new NotificationDefinition()
|
||||
{
|
||||
Name = notification.Name,
|
||||
OnGrab = notification.OnGrab,
|
||||
OnDownload = notification.OnDownload,
|
||||
Implementation = notification.Implementation,
|
||||
Settings = Json.Serialize(notification.Settings)
|
||||
};
|
||||
var definition = new NotificationDefinition();
|
||||
definition.InjectFrom(notification);
|
||||
definition.Settings = Json.Serialize(notification.Settings);
|
||||
|
||||
definition = _notificationRepository.Insert(definition);
|
||||
notification.Id = definition.Id;
|
||||
|
@ -100,11 +96,7 @@ namespace NzbDrone.Core.Notifications
|
|||
public Notification Update(Notification notification)
|
||||
{
|
||||
var definition = _notificationRepository.Get(notification.Id);
|
||||
|
||||
definition.Name = notification.Name;
|
||||
definition.OnGrab = notification.OnGrab;
|
||||
definition.OnDownload = notification.OnDownload;
|
||||
definition.Implementation = notification.Implementation;
|
||||
definition.InjectFrom(notification);
|
||||
definition.Settings = Json.Serialize(notification.Settings);
|
||||
|
||||
_notificationRepository.Update(definition);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue