1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-16 16:04:08 +01:00
Radarr/NzbDrone.Core/Notifications/Plex/PlexServer.cs
2013-05-19 18:32:25 -07:00

44 lines
968 B
C#

using NLog;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Plex
{
public class PlexServer : NotificationWithSetting<PlexServerSettings>
{
private readonly PlexProvider _plexProvider;
public PlexServer(PlexProvider plexProvider)
{
_plexProvider = plexProvider;
}
public override string Name
{
get { return "Plex Server"; }
}
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.Host);
}
}
}
}