You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.6 KiB
67 lines
1.6 KiB
using System.Collections.Generic;
|
|
using FluentValidation.Results;
|
|
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.Tv;
|
|
using Prowlin;
|
|
|
|
namespace NzbDrone.Core.Notifications.Prowl
|
|
{
|
|
public class Prowl : NotificationBase<ProwlSettings>
|
|
{
|
|
private readonly IProwlService _prowlService;
|
|
|
|
public Prowl(IProwlService prowlService)
|
|
{
|
|
_prowlService = prowlService;
|
|
}
|
|
|
|
public override string Link
|
|
{
|
|
get { return "http://www.prowlapp.com/"; }
|
|
}
|
|
|
|
public override void OnGrab(string message)
|
|
{
|
|
const string title = "Episode Grabbed";
|
|
|
|
_prowlService.SendNotification(title, message, Settings.ApiKey, (NotificationPriority)Settings.Priority);
|
|
}
|
|
|
|
public override void OnDownload(DownloadMessage message)
|
|
{
|
|
const string title = "Episode Downloaded";
|
|
|
|
_prowlService.SendNotification(title, message.Message, Settings.ApiKey, (NotificationPriority)Settings.Priority);
|
|
}
|
|
|
|
public override void OnRename(Series series)
|
|
{
|
|
}
|
|
|
|
public override string Name
|
|
{
|
|
get
|
|
{
|
|
return "Prowl";
|
|
}
|
|
}
|
|
|
|
public override bool SupportsOnRename
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public override ValidationResult Test()
|
|
{
|
|
var failures = new List<ValidationFailure>();
|
|
|
|
failures.AddIfNotNull(_prowlService.Test(Settings));
|
|
|
|
return new ValidationResult(failures);
|
|
}
|
|
}
|
|
}
|