mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 10:17:47 +00:00
8cac7ed1cd
Notification ImplementationType was added for showing in UI (Humanized/Title cased of Implementation)
28 lines
864 B
C#
28 lines
864 B
C#
using System;
|
|
using NLog;
|
|
using NzbDrone.Common.Serializer;
|
|
using NzbDrone.Core.Tv;
|
|
|
|
namespace NzbDrone.Core.Notifications
|
|
{
|
|
public abstract class NotificationBase<TSetting> : INotification where TSetting : class, INotifcationSettings, new()
|
|
{
|
|
public abstract string Name { get; }
|
|
public abstract string ImplementationName { get; }
|
|
|
|
public NotificationDefinition InstanceDefinition { get; set; }
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|