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.
44 lines
968 B
44 lines
968 B
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);
|
|
}
|
|
}
|
|
}
|
|
}
|