#114 start caching quality profiles. Set the cache on startup and when obtaining quality profiles in settings

This commit is contained in:
Drewster727 2016-04-03 20:32:36 -05:00
parent 08b14d0164
commit e8c222f66e
6 changed files with 81 additions and 14 deletions

View file

@ -374,6 +374,13 @@ namespace PlexRequests.UI.Modules
var settings = this.Bind<SonarrSettings>();
var profiles = SonarrApi.GetProfiles(settings.ApiKey, settings.FullUri);
// set the cache
if (profiles != null)
{
var cache = new MemoryCacheProvider();
cache.Set(CacheKeys.SonarrQualityProfiles, profiles);
}
return Response.AsJson(profiles);
}
@ -582,6 +589,13 @@ namespace PlexRequests.UI.Modules
var settings = this.Bind<CouchPotatoSettings>();
var profiles = CpApi.GetProfiles(settings.FullUri, settings.ApiKey);
// set the cache
if (profiles != null)
{
var cache = new MemoryCacheProvider();
cache.Set(CacheKeys.CouchPotatoQualityProfiles, profiles);
}
return Response.AsJson(profiles);
}