2013-05-19 23:17:32 +00:00
|
|
|
|
using System;
|
|
|
|
|
using NLog;
|
2013-05-20 02:43:22 +00:00
|
|
|
|
using NzbDrone.Common.Serializer;
|
2013-05-19 23:17:32 +00:00
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Notifications
|
|
|
|
|
{
|
2013-05-20 02:43:22 +00:00
|
|
|
|
public abstract class NotificationBase<TSetting> : INotification where TSetting : class, INotifcationSettings, new()
|
2013-05-19 23:17:32 +00:00
|
|
|
|
{
|
|
|
|
|
public abstract string Name { get; }
|
2013-06-13 06:41:26 +00:00
|
|
|
|
public abstract string ImplementationName { get; }
|
2013-05-19 23:17:32 +00:00
|
|
|
|
|
|
|
|
|
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);
|
2013-05-20 02:43:22 +00:00
|
|
|
|
|
|
|
|
|
public TSetting Settings { get; private set; }
|
|
|
|
|
|
|
|
|
|
public TSetting ImportSettingsFromJson(string json)
|
|
|
|
|
{
|
|
|
|
|
Settings = Json.Deserialize<TSetting>(json) ?? new TSetting();
|
|
|
|
|
|
|
|
|
|
return Settings;
|
|
|
|
|
}
|
2013-05-19 23:17:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|