Fixed a null reference issue in the Plex Content Cacher

pull/1617/head
Jamie.Rees 7 years ago
parent f5ffa78304
commit 4fc50bb40b

@ -94,6 +94,7 @@ namespace Ombi.Schedule.Jobs.Plex
Logger.LogInformation("Getting all content from server {0}", servers.Name); Logger.LogInformation("Getting all content from server {0}", servers.Name);
var allContent = GetAllContent(servers); var allContent = GetAllContent(servers);
Logger.LogInformation("We found {0} items", allContent.Count);
// Let's now process this. // Let's now process this.
var contentToAdd = new List<PlexContent>(); var contentToAdd = new List<PlexContent>();
@ -103,7 +104,7 @@ namespace Ombi.Schedule.Jobs.Plex
{ {
// Process Shows // Process Shows
Logger.LogInformation("Processing TV Shows"); Logger.LogInformation("Processing TV Shows");
foreach (var show in content.Metadata) foreach (var show in content.Metadata ?? new Metadata[]{})
{ {
var seasonList = await PlexApi.GetSeasons(servers.PlexAuthToken, servers.FullUri, var seasonList = await PlexApi.GetSeasons(servers.PlexAuthToken, servers.FullUri,
show.ratingKey); show.ratingKey);

Loading…
Cancel
Save