Fixed: Updating Plex

pull/6/head
Mark McDowall 11 years ago
parent 0a125c485b
commit 8414890017

@ -16,6 +16,8 @@ namespace NzbDrone.Core.Notifications.Plex
[JsonProperty("_children")]
public List<PlexSection> Sections { get; set; }
public Int32 Key { get; set; }
}
public class PlexMediaContainer

@ -12,7 +12,7 @@ namespace NzbDrone.Core.Notifications.Plex
{
public interface IPlexServerProxy
{
List<PlexSection> GetTvSections(PlexServerSettings settings);
List<PlexDirectory> GetTvSections(PlexServerSettings settings);
void Update(int sectionId, PlexServerSettings settings);
}
@ -25,7 +25,7 @@ namespace NzbDrone.Core.Notifications.Plex
_authCache = cacheManager.GetCache<String>(GetType(), "authCache");
}
public List<PlexSection> GetTvSections(PlexServerSettings settings)
public List<PlexDirectory> 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<PlexMediaContainer>(response.Content)
.Directories
.Where(d => d.Type == "show")
.SelectMany(d => d.Sections)
.ToList();
}

@ -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)

Loading…
Cancel
Save