diff --git a/src/Ombi.DependencyInjection/IocExtensions.cs b/src/Ombi.DependencyInjection/IocExtensions.cs index 12b53b6c5..510d88d63 100644 --- a/src/Ombi.DependencyInjection/IocExtensions.cs +++ b/src/Ombi.DependencyInjection/IocExtensions.cs @@ -144,11 +144,11 @@ 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(); diff --git a/src/Ombi.Schedule/JobSetup.cs b/src/Ombi.Schedule/JobSetup.cs index 2880dbba0..5fa66af47 100644 --- a/src/Ombi.Schedule/JobSetup.cs +++ b/src/Ombi.Schedule/JobSetup.cs @@ -11,35 +11,35 @@ namespace Ombi.Schedule { public class JobSetup : IJobSetup { - public JobSetup(IPlexContentCacher plexContentCacher, IRadarrCacher radarrCacher, - IOmbiAutomaticUpdater updater, IEmbyContentCacher embyCacher, IPlexUserImporter userImporter, + public JobSetup(IPlexContentSync plexContentSync, IRadarrCacher radarrCacher, + IOmbiAutomaticUpdater updater, IEmbyContentSync embySync, IPlexUserImporter userImporter, IEmbyUserImporter embyUserImporter, ISonarrCacher cache, ICouchPotatoCacher cpCache) { - PlexContentCacher = plexContentCacher; + PlexContentSync = plexContentSync; RadarrCacher = radarrCacher; Updater = updater; - EmbyContentCacher = embyCacher; + EmbyContentSync = embySync; PlexUserImporter = userImporter; EmbyUserImporter = embyUserImporter; SonarrCacher = cache; CpCache = cpCache; } - private IPlexContentCacher PlexContentCacher { get; } + private IPlexContentSync PlexContentSync { get; } private IRadarrCacher RadarrCacher { get; } private IOmbiAutomaticUpdater Updater { get; } private IPlexUserImporter PlexUserImporter { get; } - private IEmbyContentCacher EmbyContentCacher { get; } + private IEmbyContentSync EmbyContentSync { get; } private IEmbyUserImporter EmbyUserImporter { get; } private ISonarrCacher SonarrCacher { get; } private ICouchPotatoCacher CpCache { get; } public void Setup() { - RecurringJob.AddOrUpdate(() => EmbyContentCacher.Start(), Cron.Hourly(5)); + RecurringJob.AddOrUpdate(() => EmbyContentSync.Start(), Cron.Hourly(5)); RecurringJob.AddOrUpdate(() => SonarrCacher.Start(), Cron.Hourly(10)); RecurringJob.AddOrUpdate(() => RadarrCacher.CacheContent(), Cron.Hourly(15)); - RecurringJob.AddOrUpdate(() => PlexContentCacher.CacheContent(), Cron.Hourly(20)); + RecurringJob.AddOrUpdate(() => PlexContentSync.CacheContent(), Cron.Hourly(20)); RecurringJob.AddOrUpdate(() => CpCache.Start(), Cron.Hourly(30)); RecurringJob.AddOrUpdate(() => Updater.Update(null), Cron.HourInterval(6)); diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyContentCacher.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs similarity index 90% rename from src/Ombi.Schedule/Jobs/Emby/EmbyContentCacher.cs rename to src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs index 7bda46a41..5e70f7e8d 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyContentCacher.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs @@ -16,23 +16,23 @@ using EmbyMediaType = Ombi.Store.Entities.EmbyMediaType; namespace Ombi.Schedule.Jobs.Emby { - public class EmbyContentCacher : IEmbyContentCacher + public class EmbyContentSync : IEmbyContentSync { - public EmbyContentCacher(ISettingsService settings, IEmbyApi api, ILogger logger, - IEmbyContentRepository repo, IEmbyEpisodeCacher epCacher) + public EmbyContentSync(ISettingsService settings, IEmbyApi api, ILogger logger, + IEmbyContentRepository repo, IEmbyEpisodeSync epSync) { _logger = logger; _settings = settings; _api = api; _repo = repo; - _episodeCacher = epCacher; + _episodeSync = epSync; } - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly ISettingsService _settings; private readonly IEmbyApi _api; private readonly IEmbyContentRepository _repo; - private readonly IEmbyEpisodeCacher _episodeCacher; + private readonly IEmbyEpisodeSync _episodeSync; public async Task Start() @@ -45,7 +45,7 @@ namespace Ombi.Schedule.Jobs.Emby await StartServerCache(server); // Episodes - BackgroundJob.Enqueue(() => _episodeCacher.Start()); + BackgroundJob.Enqueue(() => _episodeSync.Start()); } diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeCacher.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs similarity index 94% rename from src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeCacher.cs rename to src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs index 792ab6752..004af7443 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeCacher.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs @@ -39,9 +39,9 @@ using Ombi.Store.Repository; namespace Ombi.Schedule.Jobs.Emby { - public class EmbyEpisodeCacher : IEmbyEpisodeCacher + public class EmbyEpisodeSync : IEmbyEpisodeSync { - public EmbyEpisodeCacher(ISettingsService s, IEmbyApi api, ILogger l, IEmbyContentRepository repo, + public EmbyEpisodeSync(ISettingsService s, IEmbyApi api, ILogger l, IEmbyContentRepository repo, IEmbyAvaliabilityChecker checker) { _api = api; @@ -53,7 +53,7 @@ namespace Ombi.Schedule.Jobs.Emby private readonly ISettingsService _settings; private readonly IEmbyApi _api; - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly IEmbyContentRepository _repo; private readonly IEmbyAvaliabilityChecker _avaliabilityChecker; diff --git a/src/Ombi.Schedule/Jobs/Emby/IEmbyContentCacher.cs b/src/Ombi.Schedule/Jobs/Emby/IEmbyContentSync.cs similarity index 71% rename from src/Ombi.Schedule/Jobs/Emby/IEmbyContentCacher.cs rename to src/Ombi.Schedule/Jobs/Emby/IEmbyContentSync.cs index 075156a63..dc6e7514e 100644 --- a/src/Ombi.Schedule/Jobs/Emby/IEmbyContentCacher.cs +++ b/src/Ombi.Schedule/Jobs/Emby/IEmbyContentSync.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; namespace Ombi.Schedule.Jobs.Emby { - public interface IEmbyContentCacher + public interface IEmbyContentSync { Task Start(); } diff --git a/src/Ombi.Schedule/Jobs/Emby/IEmbyEpisodeCacher.cs b/src/Ombi.Schedule/Jobs/Emby/IEmbyEpisodeSync.cs similarity index 71% rename from src/Ombi.Schedule/Jobs/Emby/IEmbyEpisodeCacher.cs rename to src/Ombi.Schedule/Jobs/Emby/IEmbyEpisodeSync.cs index 84eff723f..965a6fb73 100644 --- a/src/Ombi.Schedule/Jobs/Emby/IEmbyEpisodeCacher.cs +++ b/src/Ombi.Schedule/Jobs/Emby/IEmbyEpisodeSync.cs @@ -2,7 +2,7 @@ namespace Ombi.Schedule.Jobs.Emby { - public interface IEmbyEpisodeCacher + public interface IEmbyEpisodeSync { Task Start(); } diff --git a/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexContentCacher.cs b/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexContentSync.cs similarity index 72% rename from src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexContentCacher.cs rename to src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexContentSync.cs index 703c5f0c4..8f1ddb5fd 100644 --- a/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexContentCacher.cs +++ b/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexContentSync.cs @@ -2,7 +2,7 @@ namespace Ombi.Schedule.Jobs { - public interface IPlexContentCacher + public interface IPlexContentSync { Task CacheContent(); } diff --git a/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexEpisodeCacher.cs b/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexEpisodeSync.cs similarity index 71% rename from src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexEpisodeCacher.cs rename to src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexEpisodeSync.cs index b6fdc9b41..a150fa773 100644 --- a/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexEpisodeCacher.cs +++ b/src/Ombi.Schedule/Jobs/Plex/Interfaces/IPlexEpisodeSync.cs @@ -2,7 +2,7 @@ namespace Ombi.Schedule.Jobs.Plex { - public interface IPlexEpisodeCacher + public interface IPlexEpisodeSync { Task Start(); } diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs b/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs similarity index 96% rename from src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs rename to src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs index 4ffc6f30c..bcad03e59 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexContentCacher.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs @@ -41,23 +41,23 @@ using Ombi.Store.Repository; namespace Ombi.Schedule.Jobs.Plex { - public class PlexServerContentCacher : IPlexContentCacher + public class PlexContentSync : IPlexContentSync { - public PlexServerContentCacher(ISettingsService plex, IPlexApi plexApi, ILogger logger, IPlexContentRepository repo, - IPlexEpisodeCacher epsiodeCacher) + public PlexContentSync(ISettingsService plex, IPlexApi plexApi, ILogger logger, IPlexContentRepository repo, + IPlexEpisodeSync epsiodeSync) { Plex = plex; PlexApi = plexApi; Logger = logger; Repo = repo; - EpisodeCacher = epsiodeCacher; + EpisodeSync = epsiodeSync; } private ISettingsService Plex { get; } private IPlexApi PlexApi { get; } - private ILogger Logger { get; } + private ILogger Logger { get; } private IPlexContentRepository Repo { get; } - private IPlexEpisodeCacher EpisodeCacher { get; } + private IPlexEpisodeSync EpisodeSync { get; } public async Task CacheContent() { @@ -79,7 +79,7 @@ namespace Ombi.Schedule.Jobs.Plex Logger.LogInformation("Starting EP Cacher"); - BackgroundJob.Enqueue(() => EpisodeCacher.Start()); + BackgroundJob.Enqueue(() => EpisodeSync.Start()); } catch (Exception e) { diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs b/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeSync.cs similarity index 96% rename from src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs rename to src/Ombi.Schedule/Jobs/Plex/PlexEpisodeSync.cs index 261d4328d..81ebf3467 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeCacher.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexEpisodeSync.cs @@ -14,9 +14,9 @@ using Ombi.Store.Repository; namespace Ombi.Schedule.Jobs.Plex { - public class PlexEpisodeCacher : IPlexEpisodeCacher + public class PlexEpisodeSync : IPlexEpisodeSync { - public PlexEpisodeCacher(ISettingsService s, ILogger log, IPlexApi plexApi, + public PlexEpisodeSync(ISettingsService s, ILogger log, IPlexApi plexApi, IPlexContentRepository repo, IPlexAvailabilityChecker a) { _settings = s; @@ -27,7 +27,7 @@ namespace Ombi.Schedule.Jobs.Plex } private readonly ISettingsService _settings; - private readonly ILogger _log; + private readonly ILogger _log; private readonly IPlexApi _api; private readonly IPlexContentRepository _repo; private readonly IPlexAvailabilityChecker _availabilityChecker; diff --git a/src/Ombi.Settings/Settings/Models/JobSettings.cs b/src/Ombi.Settings/Settings/Models/JobSettings.cs new file mode 100644 index 000000000..28e3c59f3 --- /dev/null +++ b/src/Ombi.Settings/Settings/Models/JobSettings.cs @@ -0,0 +1,7 @@ +namespace Ombi.Settings.Settings.Models +{ + public class JobSettings + { + + } +} \ No newline at end of file diff --git a/src/Ombi/Controllers/JobController.cs b/src/Ombi/Controllers/JobController.cs index 458ccc8b2..bca6f752d 100644 --- a/src/Ombi/Controllers/JobController.cs +++ b/src/Ombi/Controllers/JobController.cs @@ -19,23 +19,23 @@ namespace Ombi.Controllers public class JobController : Controller { public JobController(IOmbiAutomaticUpdater updater, IPlexUserImporter userImporter, - IMemoryCache mem, IEmbyUserImporter embyImporter, IPlexContentCacher plexContentCacher, - IEmbyContentCacher embyContentCacher) + IMemoryCache mem, IEmbyUserImporter embyImporter, IPlexContentSync plexContentSync, + IEmbyContentSync embyContentSync) { _updater = updater; _plexUserImporter = userImporter; _embyUserImporter = embyImporter; _memCache = mem; - _plexContentCacher = plexContentCacher; - _embyContentCacher = embyContentCacher; + _plexContentSync = plexContentSync; + _embyContentSync = embyContentSync; } private readonly IOmbiAutomaticUpdater _updater; private readonly IPlexUserImporter _plexUserImporter; private readonly IEmbyUserImporter _embyUserImporter; private readonly IMemoryCache _memCache; - private readonly IPlexContentCacher _plexContentCacher; - private readonly IEmbyContentCacher _embyContentCacher; + private readonly IPlexContentSync _plexContentSync; + private readonly IEmbyContentSync _embyContentSync; /// /// Runs the update job @@ -116,7 +116,7 @@ namespace Ombi.Controllers [HttpPost("plexcontentcacher")] public bool StartPlexContentCacher() { - BackgroundJob.Enqueue(() => _plexContentCacher.CacheContent()); + BackgroundJob.Enqueue(() => _plexContentSync.CacheContent()); return true; } @@ -127,7 +127,7 @@ namespace Ombi.Controllers [HttpPost("embycontentcacher")] public bool StartEmbyContentCacher() { - BackgroundJob.Enqueue(() => _embyContentCacher.Start()); + BackgroundJob.Enqueue(() => _embyContentSync.Start()); return true; } }