Ejemplo n.º 1
0
 private void CacheCouchPotatoQualityProfiles(ICacheProvider cacheProvider)
 {
     try
     {
         var cpSettingsService = new SettingsServiceV2 <CouchPotatoSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), cacheProvider));
         var cpSettings        = cpSettingsService.GetSettings();
         if (cpSettings.Enabled)
         {
             Log.Info("Begin executing GetProfiles call to CouchPotato for quality profiles");
             CouchPotatoApi cpApi    = new CouchPotatoApi();
             var            profiles = cpApi.GetProfiles(cpSettings.FullUri, cpSettings.ApiKey);
             cacheProvider.Set(CacheKeys.CouchPotatoQualityProfiles, profiles);
             Log.Info("Finished executing GetProfiles call to CouchPotato for quality profiles");
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex, "Failed to cache CouchPotato quality profiles!");
     }
 }
Ejemplo n.º 2
0
 private void CacheRadarrQualityProfiles(ICacheProvider cacheProvider)
 {
     try
     {
         var radarrService  = new SettingsServiceV2 <RadarrSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), cacheProvider));
         var radarrSettings = radarrService.GetSettings();
         if (radarrSettings.Enabled)
         {
             Log.Info("Begin executing GetProfiles call to Radarr for quality profiles");
             RadarrApi radarrApi = new RadarrApi();
             var       profiles  = radarrApi.GetProfiles(radarrSettings.ApiKey, radarrSettings.FullUri);
             cacheProvider.Set(CacheKeys.RadarrQualityProfiles, profiles);
             Log.Info("Finished executing GetProfiles call to Radarr for quality profiles");
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex, "Failed to cache Sonarr quality profiles!");
     }
 }