mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Cleaned up Notifications a bit
This commit is contained in:
parent
922d4becc5
commit
a153599d50
14 changed files with 23 additions and 62 deletions
|
@ -1,10 +1,11 @@
|
|||
using System;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.Notifications
|
||||
{
|
||||
public abstract class NotificationBase : INotification
|
||||
public abstract class NotificationBase<TSetting> : INotification where TSetting : class, INotifcationSettings, new()
|
||||
{
|
||||
public abstract string Name { get; }
|
||||
|
||||
|
@ -13,5 +14,14 @@ namespace NzbDrone.Core.Notifications
|
|||
public abstract void OnGrab(string message);
|
||||
public abstract void OnDownload(string message, Series series);
|
||||
public abstract void AfterRename(Series series);
|
||||
|
||||
public TSetting Settings { get; private set; }
|
||||
|
||||
public TSetting ImportSettingsFromJson(string json)
|
||||
{
|
||||
Settings = Json.Deserialize<TSetting>(json) ?? new TSetting();
|
||||
|
||||
return Settings;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue