2013-07-19 05:47:55 +02:00
|
|
|
|
using NzbDrone.Core.Tv;
|
2013-05-20 01:17:32 +02:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Notifications.Plex
|
|
|
|
|
{
|
2013-05-20 04:43:22 +02:00
|
|
|
|
public class PlexServer : NotificationBase<PlexServerSettings>
|
2013-05-20 01:17:32 +02:00
|
|
|
|
{
|
2013-06-13 08:41:26 +02:00
|
|
|
|
private readonly IPlexService _plexProvider;
|
2013-05-20 01:17:32 +02:00
|
|
|
|
|
2013-06-13 08:41:26 +02:00
|
|
|
|
public PlexServer(IPlexService plexProvider)
|
2013-05-20 01:17:32 +02:00
|
|
|
|
{
|
|
|
|
|
_plexProvider = plexProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Plex Server"; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-13 08:41:26 +02:00
|
|
|
|
public override string ImplementationName
|
|
|
|
|
{
|
|
|
|
|
get { return "Plex Server"; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-27 22:57:41 +02:00
|
|
|
|
public override string Link
|
|
|
|
|
{
|
|
|
|
|
get { return "http://www.plexapp.com/"; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-20 01:17:32 +02:00
|
|
|
|
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)
|
|
|
|
|
{
|
2013-06-13 08:41:26 +02:00
|
|
|
|
_plexProvider.UpdateLibrary(Settings);
|
2013-05-20 01:17:32 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|