From e090800cd741f6732a5f6206708b5928cf19b81e Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 20 Nov 2017 13:55:10 +0000 Subject: [PATCH] more renames --- src/Ombi.DependencyInjection/IocExtensions.cs | 6 +++--- src/Ombi.Schedule/JobSetup.cs | 18 +++++++++--------- ...CouchPotatoCacher.cs => CouchPotatoSync.cs} | 8 ++++---- ...ouchPotatoCacher.cs => ICouchPotatoSync.cs} | 2 +- .../{IRadarrCacher.cs => IRadarrSync.cs} | 2 +- .../Radarr/{RadarrCacher.cs => RadarrSync.cs} | 6 +++--- .../{ISonarrCacher.cs => ISonarrSync.cs} | 2 +- .../Sonarr/{SonarrCacher.cs => SonarrSync.cs} | 6 +++--- .../Settings/Models/JobSettings.cs | 4 +++- src/Ombi/Controllers/SettingsController.cs | 10 +++++----- 10 files changed, 33 insertions(+), 31 deletions(-) rename src/Ombi.Schedule/Jobs/Couchpotato/{CouchPotatoCacher.cs => CouchPotatoSync.cs} (93%) rename src/Ombi.Schedule/Jobs/Couchpotato/{ICouchPotatoCacher.cs => ICouchPotatoSync.cs} (73%) rename src/Ombi.Schedule/Jobs/Radarr/{IRadarrCacher.cs => IRadarrSync.cs} (86%) rename src/Ombi.Schedule/Jobs/Radarr/{RadarrCacher.cs => RadarrSync.cs} (92%) rename src/Ombi.Schedule/Jobs/Sonarr/{ISonarrCacher.cs => ISonarrSync.cs} (74%) rename src/Ombi.Schedule/Jobs/Sonarr/{SonarrCacher.cs => SonarrSync.cs} (95%) diff --git a/src/Ombi.DependencyInjection/IocExtensions.cs b/src/Ombi.DependencyInjection/IocExtensions.cs index 510d88d63..4ca7722b3 100644 --- a/src/Ombi.DependencyInjection/IocExtensions.cs +++ b/src/Ombi.DependencyInjection/IocExtensions.cs @@ -151,13 +151,13 @@ namespace Ombi.DependencyInjection services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); } } diff --git a/src/Ombi.Schedule/JobSetup.cs b/src/Ombi.Schedule/JobSetup.cs index 5fa66af47..5a9c8f4f3 100644 --- a/src/Ombi.Schedule/JobSetup.cs +++ b/src/Ombi.Schedule/JobSetup.cs @@ -11,34 +11,34 @@ namespace Ombi.Schedule { public class JobSetup : IJobSetup { - public JobSetup(IPlexContentSync plexContentSync, IRadarrCacher radarrCacher, + public JobSetup(IPlexContentSync plexContentSync, IRadarrSync radarrSync, IOmbiAutomaticUpdater updater, IEmbyContentSync embySync, IPlexUserImporter userImporter, - IEmbyUserImporter embyUserImporter, ISonarrCacher cache, ICouchPotatoCacher cpCache) + IEmbyUserImporter embyUserImporter, ISonarrSync cache, ICouchPotatoSync cpCache) { PlexContentSync = plexContentSync; - RadarrCacher = radarrCacher; + RadarrSync = radarrSync; Updater = updater; EmbyContentSync = embySync; PlexUserImporter = userImporter; EmbyUserImporter = embyUserImporter; - SonarrCacher = cache; + SonarrSync = cache; CpCache = cpCache; } private IPlexContentSync PlexContentSync { get; } - private IRadarrCacher RadarrCacher { get; } + private IRadarrSync RadarrSync { get; } private IOmbiAutomaticUpdater Updater { get; } private IPlexUserImporter PlexUserImporter { get; } private IEmbyContentSync EmbyContentSync { get; } private IEmbyUserImporter EmbyUserImporter { get; } - private ISonarrCacher SonarrCacher { get; } - private ICouchPotatoCacher CpCache { get; } + private ISonarrSync SonarrSync { get; } + private ICouchPotatoSync CpCache { get; } public void Setup() { RecurringJob.AddOrUpdate(() => EmbyContentSync.Start(), Cron.Hourly(5)); - RecurringJob.AddOrUpdate(() => SonarrCacher.Start(), Cron.Hourly(10)); - RecurringJob.AddOrUpdate(() => RadarrCacher.CacheContent(), Cron.Hourly(15)); + RecurringJob.AddOrUpdate(() => SonarrSync.Start(), Cron.Hourly(10)); + RecurringJob.AddOrUpdate(() => RadarrSync.CacheContent(), Cron.Hourly(15)); RecurringJob.AddOrUpdate(() => PlexContentSync.CacheContent(), Cron.Hourly(20)); RecurringJob.AddOrUpdate(() => CpCache.Start(), Cron.Hourly(30)); diff --git a/src/Ombi.Schedule/Jobs/Couchpotato/CouchPotatoCacher.cs b/src/Ombi.Schedule/Jobs/Couchpotato/CouchPotatoSync.cs similarity index 93% rename from src/Ombi.Schedule/Jobs/Couchpotato/CouchPotatoCacher.cs rename to src/Ombi.Schedule/Jobs/Couchpotato/CouchPotatoSync.cs index 79ed8a30c..ec2f8d247 100644 --- a/src/Ombi.Schedule/Jobs/Couchpotato/CouchPotatoCacher.cs +++ b/src/Ombi.Schedule/Jobs/Couchpotato/CouchPotatoSync.cs @@ -39,10 +39,10 @@ using Ombi.Store.Entities; namespace Ombi.Schedule.Jobs.Couchpotato { - public class CouchPotatoCacher : ICouchPotatoCacher + public class CouchPotatoSync : ICouchPotatoSync { - public CouchPotatoCacher(ISettingsService cpSettings, - ICouchPotatoApi api, ILogger log, IOmbiContext ctx) + public CouchPotatoSync(ISettingsService cpSettings, + ICouchPotatoApi api, ILogger log, IOmbiContext ctx) { _settings = cpSettings; _api = api; @@ -52,7 +52,7 @@ namespace Ombi.Schedule.Jobs.Couchpotato private readonly ISettingsService _settings; private readonly ICouchPotatoApi _api; - private readonly ILogger _log; + private readonly ILogger _log; private readonly IOmbiContext _ctx; public async Task Start() diff --git a/src/Ombi.Schedule/Jobs/Couchpotato/ICouchPotatoCacher.cs b/src/Ombi.Schedule/Jobs/Couchpotato/ICouchPotatoSync.cs similarity index 73% rename from src/Ombi.Schedule/Jobs/Couchpotato/ICouchPotatoCacher.cs rename to src/Ombi.Schedule/Jobs/Couchpotato/ICouchPotatoSync.cs index 6a115d438..190819754 100644 --- a/src/Ombi.Schedule/Jobs/Couchpotato/ICouchPotatoCacher.cs +++ b/src/Ombi.Schedule/Jobs/Couchpotato/ICouchPotatoSync.cs @@ -2,7 +2,7 @@ namespace Ombi.Schedule.Jobs.Couchpotato { - public interface ICouchPotatoCacher + public interface ICouchPotatoSync { Task Start(); } diff --git a/src/Ombi.Schedule/Jobs/Radarr/IRadarrCacher.cs b/src/Ombi.Schedule/Jobs/Radarr/IRadarrSync.cs similarity index 86% rename from src/Ombi.Schedule/Jobs/Radarr/IRadarrCacher.cs rename to src/Ombi.Schedule/Jobs/Radarr/IRadarrSync.cs index 633cadef9..bcf6539e0 100644 --- a/src/Ombi.Schedule/Jobs/Radarr/IRadarrCacher.cs +++ b/src/Ombi.Schedule/Jobs/Radarr/IRadarrSync.cs @@ -4,7 +4,7 @@ using Ombi.Store.Entities; namespace Ombi.Schedule.Jobs.Radarr { - public interface IRadarrCacher + public interface IRadarrSync { Task CacheContent(); Task> GetCachedContent(); diff --git a/src/Ombi.Schedule/Jobs/Radarr/RadarrCacher.cs b/src/Ombi.Schedule/Jobs/Radarr/RadarrSync.cs similarity index 92% rename from src/Ombi.Schedule/Jobs/Radarr/RadarrCacher.cs rename to src/Ombi.Schedule/Jobs/Radarr/RadarrSync.cs index 5aa2cc49b..92cf713a3 100644 --- a/src/Ombi.Schedule/Jobs/Radarr/RadarrCacher.cs +++ b/src/Ombi.Schedule/Jobs/Radarr/RadarrSync.cs @@ -14,9 +14,9 @@ using Serilog; namespace Ombi.Schedule.Jobs.Radarr { - public class RadarrCacher : IRadarrCacher + public class RadarrSync : IRadarrSync { - public RadarrCacher(ISettingsService radarr, IRadarrApi radarrApi, ILogger log, IOmbiContext ctx) + public RadarrSync(ISettingsService radarr, IRadarrApi radarrApi, ILogger log, IOmbiContext ctx) { RadarrSettings = radarr; RadarrApi = radarrApi; @@ -26,7 +26,7 @@ namespace Ombi.Schedule.Jobs.Radarr private ISettingsService RadarrSettings { get; } private IRadarrApi RadarrApi { get; } - private ILogger Logger { get; } + private ILogger Logger { get; } private readonly IOmbiContext _ctx; private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1); diff --git a/src/Ombi.Schedule/Jobs/Sonarr/ISonarrCacher.cs b/src/Ombi.Schedule/Jobs/Sonarr/ISonarrSync.cs similarity index 74% rename from src/Ombi.Schedule/Jobs/Sonarr/ISonarrCacher.cs rename to src/Ombi.Schedule/Jobs/Sonarr/ISonarrSync.cs index e3b968784..4d675b496 100644 --- a/src/Ombi.Schedule/Jobs/Sonarr/ISonarrCacher.cs +++ b/src/Ombi.Schedule/Jobs/Sonarr/ISonarrSync.cs @@ -2,7 +2,7 @@ namespace Ombi.Schedule.Jobs.Sonarr { - public interface ISonarrCacher + public interface ISonarrSync { Task Start(); } diff --git a/src/Ombi.Schedule/Jobs/Sonarr/SonarrCacher.cs b/src/Ombi.Schedule/Jobs/Sonarr/SonarrSync.cs similarity index 95% rename from src/Ombi.Schedule/Jobs/Sonarr/SonarrCacher.cs rename to src/Ombi.Schedule/Jobs/Sonarr/SonarrSync.cs index 67c32e1dc..79d948a0c 100644 --- a/src/Ombi.Schedule/Jobs/Sonarr/SonarrCacher.cs +++ b/src/Ombi.Schedule/Jobs/Sonarr/SonarrSync.cs @@ -16,9 +16,9 @@ using Ombi.Store.Entities; namespace Ombi.Schedule.Jobs.Sonarr { - public class SonarrCacher : ISonarrCacher + public class SonarrSync : ISonarrSync { - public SonarrCacher(ISettingsService s, ISonarrApi api, ILogger l, IOmbiContext ctx) + public SonarrSync(ISettingsService s, ISonarrApi api, ILogger l, IOmbiContext ctx) { _settings = s; _api = api; @@ -28,7 +28,7 @@ namespace Ombi.Schedule.Jobs.Sonarr private readonly ISettingsService _settings; private readonly ISonarrApi _api; - private readonly ILogger _log; + private readonly ILogger _log; private readonly IOmbiContext _ctx; private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1); diff --git a/src/Ombi.Settings/Settings/Models/JobSettings.cs b/src/Ombi.Settings/Settings/Models/JobSettings.cs index 28e3c59f3..eb40ba8a6 100644 --- a/src/Ombi.Settings/Settings/Models/JobSettings.cs +++ b/src/Ombi.Settings/Settings/Models/JobSettings.cs @@ -2,6 +2,8 @@ { public class JobSettings { - + public string EmbyContentSync { get; set; } + public string SonarrSync { get; set; } + public string RadarrSync { get; set; } } } \ No newline at end of file diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index bf315e88d..40edf7a28 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -44,14 +44,14 @@ namespace Ombi.Controllers /// The mapper. /// The templateRepo. /// The embyApi. - /// The radarrCacher. + /// The radarrCacher. /// The memory cache. /// The memory cache. public SettingsController(ISettingsResolver resolver, IMapper mapper, INotificationTemplatesRepository templateRepo, IEmbyApi embyApi, - IRadarrCacher radarrCacher, + IRadarrSync radarrSync, IMemoryCache memCache, IGithubApi githubApi) { @@ -59,7 +59,7 @@ namespace Ombi.Controllers Mapper = mapper; TemplateRepository = templateRepo; _embyApi = embyApi; - _radarrCacher = radarrCacher; + _radarrSync = radarrSync; _cache = memCache; _githubApi = githubApi; } @@ -68,7 +68,7 @@ namespace Ombi.Controllers private IMapper Mapper { get; } private INotificationTemplatesRepository TemplateRepository { get; } private readonly IEmbyApi _embyApi; - private readonly IRadarrCacher _radarrCacher; + private readonly IRadarrSync _radarrSync; private readonly IMemoryCache _cache; private readonly IGithubApi _githubApi; @@ -332,7 +332,7 @@ namespace Ombi.Controllers { _cache.Remove(CacheKeys.RadarrRootProfiles); _cache.Remove(CacheKeys.RadarrQualityProfiles); - BackgroundJob.Enqueue(() => _radarrCacher.CacheContent()); + BackgroundJob.Enqueue(() => _radarrSync.CacheContent()); } return result; }