mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: Updating Plex
This commit is contained in:
parent
0a125c485b
commit
8414890017
@ -16,6 +16,8 @@ public class PlexDirectory
|
||||
|
||||
[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 @@ public PlexServerProxy(ICacheManager cacheManager)
|
||||
_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 @@ public List<PlexSection> GetTvSections(PlexServerSettings settings)
|
||||
return Json.Deserialize<PlexMediaContainer>(response.Content)
|
||||
.Directories
|
||||
.Where(d => d.Type == "show")
|
||||
.SelectMany(d => d.Sections)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ private List<int> GetSectionKeys(PlexServerSettings settings)
|
||||
{
|
||||
_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…
Reference in New Issue
Block a user