Done the same for TV

pull/332/head
tidusjar 9 years ago
parent 41b439d3bb
commit a003068869

@ -190,23 +190,31 @@ namespace PlexRequests.UI.Modules
IEnumerable<QualityModel> qualities = new List<QualityModel>();
if (IsAdmin)
{
var sonarrSettings = SonarrSettings.GetSettings();
if (sonarrSettings.Enabled)
try
{
var result = Cache.GetOrSetAsync(CacheKeys.SonarrQualityProfiles, async () =>
var sonarrSettings = SonarrSettings.GetSettings();
if (sonarrSettings.Enabled)
{
return await Task.Run(() => SonarrApi.GetProfiles(sonarrSettings.ApiKey, sonarrSettings.FullUri));
});
qualities = result.Result.Select(x => new QualityModel() { Id = x.id.ToString(), Name = x.name }).ToList();
}
else
{
var sickRageSettings = SickRageSettings.GetSettings();
if (sickRageSettings.Enabled)
var result = Cache.GetOrSetAsync(CacheKeys.SonarrQualityProfiles, async () =>
{
return await Task.Run(() => SonarrApi.GetProfiles(sonarrSettings.ApiKey, sonarrSettings.FullUri));
});
qualities = result.Result.Select(x => new QualityModel() { Id = x.id.ToString(), Name = x.name }).ToList();
}
else
{
qualities = sickRageSettings.Qualities.Select(x => new QualityModel() { Id = x.Key, Name = x.Value }).ToList();
var sickRageSettings = SickRageSettings.GetSettings();
if (sickRageSettings.Enabled)
{
qualities = sickRageSettings.Qualities.Select(x => new QualityModel() { Id = x.Key, Name = x.Value }).ToList();
}
}
}
catch (Exception e)
{
Log.Info(e);
}
}
var viewModel = dbTv.Select(tv =>

Loading…
Cancel
Save