From 841489001750304263265b2e29565f0d1565f955 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 18 Apr 2014 20:22:35 -0700 Subject: [PATCH] Fixed: Updating Plex --- src/NzbDrone.Core/Notifications/Plex/PlexSection.cs | 2 ++ src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs | 5 ++--- src/NzbDrone.Core/Notifications/Plex/PlexService.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexSection.cs b/src/NzbDrone.Core/Notifications/Plex/PlexSection.cs index d43fb53f6..0b7e96e4a 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexSection.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexSection.cs @@ -16,6 +16,8 @@ namespace NzbDrone.Core.Notifications.Plex [JsonProperty("_children")] public List Sections { get; set; } + + public Int32 Key { get; set; } } public class PlexMediaContainer diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs index e94091e7b..726cac410 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Core.Notifications.Plex { public interface IPlexServerProxy { - List GetTvSections(PlexServerSettings settings); + List GetTvSections(PlexServerSettings settings); void Update(int sectionId, PlexServerSettings settings); } @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Notifications.Plex _authCache = cacheManager.GetCache(GetType(), "authCache"); } - public List GetTvSections(PlexServerSettings settings) + public List GetTvSections(PlexServerSettings settings) { var request = GetPlexServerRequest("library/sections", Method.GET, settings); var client = GetPlexServerClient(settings); @@ -35,7 +35,6 @@ namespace NzbDrone.Core.Notifications.Plex return Json.Deserialize(response.Content) .Directories .Where(d => d.Type == "show") - .SelectMany(d => d.Sections) .ToList(); } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexService.cs index a27b55d3a..d141916c5 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexService.cs @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Notifications.Plex { _logger.Debug("Getting sections from Plex host: {0}", settings.Host); - return _plexServerProxy.GetTvSections(settings).Select(s => s.Id).ToList(); + return _plexServerProxy.GetTvSections(settings).Select(s => s.Key).ToList(); } private void UpdateSection(int key, PlexServerSettings settings)