Radarr/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs
vertigo235 9e7cb708bf Initial Notification Updates and Support (#401)
* Bare bones of notifications working.

* Add MovieDownload event handler

To allow Download notificaitons

* Update pushover text to indicate movie

* Initial Notification Support

On Download and On Grab notifications should work.

* Telegram Notification Text

* Update Custom Script For Movies

* Update PP script WiKi page

Also added wiki page to Radarr wiki.
2017-01-24 20:17:24 +01:00

50 lines
1.3 KiB
C#

using System.Collections.Generic;
using FluentValidation.Results;
using NzbDrone.Core.Tv;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.Notifications.Webhook
{
public class Webhook : NotificationBase<WebhookSettings>
{
private readonly IWebhookService _service;
public Webhook(IWebhookService service)
{
_service = service;
}
public override string Link => "https://github.com/Sonarr/Sonarr/wiki/Webhook";
public override void OnGrab(GrabMessage message)
{
_service.OnGrab(message.Series, message.Episode, message.Quality, Settings);
}
public override void OnDownload(DownloadMessage message)
{
_service.OnDownload(message.Series, message.EpisodeFile, Settings);
}
public override void OnMovieRename(Movie movie)
{
}
public override void OnRename(Series series)
{
_service.OnRename(series, Settings);
}
public override string Name => "Webhook";
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();
failures.AddIfNotNull(_service.Test(Settings));
return new ValidationResult(failures);
}
}
}