1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/NzbDrone.Core/Notifications/Plex/PlexServer.cs
2013-07-27 13:57:41 -07:00

52 lines
1.1 KiB
C#

using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Plex
{
public class PlexServer : NotificationBase<PlexServerSettings>
{
private readonly IPlexService _plexProvider;
public PlexServer(IPlexService plexProvider)
{
_plexProvider = plexProvider;
}
public override string Name
{
get { return "Plex Server"; }
}
public override string ImplementationName
{
get { return "Plex Server"; }
}
public override string Link
{
get { return "http://www.plexapp.com/"; }
}
public override void OnGrab(string message)
{
}
public override void OnDownload(string message, Series series)
{
UpdateIfEnabled();
}
public override void AfterRename(Series series)
{
UpdateIfEnabled();
}
private void UpdateIfEnabled()
{
if (Settings.UpdateLibrary)
{
_plexProvider.UpdateLibrary(Settings);
}
}
}
}