From 3f64c01d5b1a123c448ed7abe196934a334dde6c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 7 Dec 2016 12:54:04 -0800 Subject: [PATCH] Fixed: Partial library updates for Plex Media Server 1.3 --- src/NzbDrone.Core/Notifications/Plex/Models/PlexSection.cs | 5 +++-- .../Notifications/Plex/Models/PlexSectionItem.cs | 3 ++- src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Plex/Models/PlexSection.cs b/src/NzbDrone.Core/Notifications/Plex/Models/PlexSection.cs index 87b5e9faa..71aab1988 100644 --- a/src/NzbDrone.Core/Notifications/Plex/Models/PlexSection.cs +++ b/src/NzbDrone.Core/Notifications/Plex/Models/PlexSection.cs @@ -17,12 +17,13 @@ public class PlexSection public string Type { get; set; } public string Language { get; set; } - public PlexSectionLocation Location { get; set; } + [JsonProperty("Location")] + public List Locations { get; set; } } public class PlexSectionsContainer { - [JsonProperty("Metadata")] + [JsonProperty("Directory")] public List Sections { get; set; } } diff --git a/src/NzbDrone.Core/Notifications/Plex/Models/PlexSectionItem.cs b/src/NzbDrone.Core/Notifications/Plex/Models/PlexSectionItem.cs index 07ce5dfa2..1531d677d 100644 --- a/src/NzbDrone.Core/Notifications/Plex/Models/PlexSectionItem.cs +++ b/src/NzbDrone.Core/Notifications/Plex/Models/PlexSectionItem.cs @@ -13,7 +13,8 @@ public class PlexSectionItem public class PlexSectionResponse { - public List Metadata { get; set; } + [JsonProperty("Metadata")] + public List Items { get; set; } } public class PlexSectionResponseLegacy diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs index 5ad44f555..14098231f 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs @@ -53,7 +53,7 @@ public List GetTvSections(PlexServerSettings settings) { Id = s.Id, Language = s.Language, - Location = s.Locations.FirstOrDefault(), + Locations = s.Locations, Type = s.Type }) .ToList(); @@ -151,7 +151,7 @@ public List Preferences(PlexServerSettings settings) { items = Json.Deserialize>(response.Content) .MediaContainer - .Metadata; + .Items; } if (items == null || items.Empty())