!wip fixed an error in the emby servers code

pull/1529/head
tidusjar 7 years ago
parent 18be4a89f7
commit 9bb29aac33

@ -5,7 +5,7 @@ namespace Ombi.Core.Settings.Models.External
public sealed class EmbySettings : Ombi.Settings.Settings.Models.Settings public sealed class EmbySettings : Ombi.Settings.Settings.Models.Settings
{ {
public bool Enable { get; set; } public bool Enable { get; set; }
public List<EmbyServers> Servers { get; set; } public List<EmbyServers> Servers { get; set; } = new List<EmbyServers>();
} }
public class EmbyServers : ExternalSettings public class EmbyServers : ExternalSettings

@ -72,7 +72,7 @@ namespace Ombi.Controllers.External
{ {
var vm = new List<UsersViewModel>(); var vm = new List<UsersViewModel>();
var s = await EmbySettings.GetSettingsAsync(); var s = await EmbySettings.GetSettingsAsync();
foreach (var server in s.Servers) foreach (var server in s?.Servers ?? new List<EmbyServers>())
{ {
var users = await EmbyApi.GetUsers(server.FullUri, server.ApiKey); var users = await EmbyApi.GetUsers(server.FullUri, server.ApiKey);
if (users != null && users.Any()) if (users != null && users.Any())

Loading…
Cancel
Save