2013-05-20 02:17:32 +03:00
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Notifications.Plex
|
|
|
|
{
|
2013-05-20 05:43:22 +03:00
|
|
|
public class PlexServer : NotificationBase<PlexServerSettings>
|
2013-05-20 02:17:32 +03:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|