1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00
Files
Radarr/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs
T
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

53 lines
1.4 KiB
C#

using System.Collections.Generic;
using FluentValidation.Results;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Plex
{
public class PlexClient : NotificationBase<PlexClientSettings>
{
private readonly IPlexClientService _plexClientService;
public PlexClient(IPlexClientService plexClientService)
{
_plexClientService = plexClientService;
}
public override string Link => "http://www.plexapp.com/";
public override void OnGrab(GrabMessage grabMessage)
{
const string header = "Radarr [TV] - Grabbed";
_plexClientService.Notify(Settings, header, grabMessage.Message);
}
public override void OnDownload(DownloadMessage message)
{
const string header = "Radarr [TV] - Downloaded";
_plexClientService.Notify(Settings, header, message.Message);
}
public override void OnMovieRename(Movie movie)
{
}
public override void OnRename(Series series)
{
}
public override string Name => "Plex Media Center";
public override bool SupportsOnRename => false;
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();
failures.AddIfNotNull(_plexClientService.Test(Settings));
return new ValidationResult(failures);
}
}
}