more renames

pull/1741/head
Jamie 7 years ago
parent 191c46d7aa
commit e090800cd7

@ -151,13 +151,13 @@ namespace Ombi.DependencyInjection
services.AddTransient<IPlexEpisodeSync, PlexEpisodeSync>(); services.AddTransient<IPlexEpisodeSync, PlexEpisodeSync>();
services.AddTransient<IPlexAvailabilityChecker, PlexAvailabilityChecker>(); services.AddTransient<IPlexAvailabilityChecker, PlexAvailabilityChecker>();
services.AddTransient<IJobSetup, JobSetup>(); services.AddTransient<IJobSetup, JobSetup>();
services.AddTransient<IRadarrCacher, RadarrCacher>(); services.AddTransient<IRadarrSync, RadarrSync>();
services.AddTransient<ISonarrCacher, SonarrCacher>(); services.AddTransient<ISonarrSync, SonarrSync>();
services.AddTransient<IOmbiAutomaticUpdater, OmbiAutomaticUpdater>(); services.AddTransient<IOmbiAutomaticUpdater, OmbiAutomaticUpdater>();
services.AddTransient<IPlexUserImporter, PlexUserImporter>(); services.AddTransient<IPlexUserImporter, PlexUserImporter>();
services.AddTransient<IEmbyUserImporter, EmbyUserImporter>(); services.AddTransient<IEmbyUserImporter, EmbyUserImporter>();
services.AddTransient<IWelcomeEmail, WelcomeEmail>(); services.AddTransient<IWelcomeEmail, WelcomeEmail>();
services.AddTransient<ICouchPotatoCacher, CouchPotatoCacher>(); services.AddTransient<ICouchPotatoSync, CouchPotatoSync>();
services.AddTransient<IProcessProvider, ProcessProvider>(); services.AddTransient<IProcessProvider, ProcessProvider>();
} }
} }

@ -11,34 +11,34 @@ namespace Ombi.Schedule
{ {
public class JobSetup : IJobSetup public class JobSetup : IJobSetup
{ {
public JobSetup(IPlexContentSync plexContentSync, IRadarrCacher radarrCacher, public JobSetup(IPlexContentSync plexContentSync, IRadarrSync radarrSync,
IOmbiAutomaticUpdater updater, IEmbyContentSync embySync, IPlexUserImporter userImporter, IOmbiAutomaticUpdater updater, IEmbyContentSync embySync, IPlexUserImporter userImporter,
IEmbyUserImporter embyUserImporter, ISonarrCacher cache, ICouchPotatoCacher cpCache) IEmbyUserImporter embyUserImporter, ISonarrSync cache, ICouchPotatoSync cpCache)
{ {
PlexContentSync = plexContentSync; PlexContentSync = plexContentSync;
RadarrCacher = radarrCacher; RadarrSync = radarrSync;
Updater = updater; Updater = updater;
EmbyContentSync = embySync; EmbyContentSync = embySync;
PlexUserImporter = userImporter; PlexUserImporter = userImporter;
EmbyUserImporter = embyUserImporter; EmbyUserImporter = embyUserImporter;
SonarrCacher = cache; SonarrSync = cache;
CpCache = cpCache; CpCache = cpCache;
} }
private IPlexContentSync PlexContentSync { get; } private IPlexContentSync PlexContentSync { get; }
private IRadarrCacher RadarrCacher { get; } private IRadarrSync RadarrSync { get; }
private IOmbiAutomaticUpdater Updater { get; } private IOmbiAutomaticUpdater Updater { get; }
private IPlexUserImporter PlexUserImporter { get; } private IPlexUserImporter PlexUserImporter { get; }
private IEmbyContentSync EmbyContentSync { get; } private IEmbyContentSync EmbyContentSync { get; }
private IEmbyUserImporter EmbyUserImporter { get; } private IEmbyUserImporter EmbyUserImporter { get; }
private ISonarrCacher SonarrCacher { get; } private ISonarrSync SonarrSync { get; }
private ICouchPotatoCacher CpCache { get; } private ICouchPotatoSync CpCache { get; }
public void Setup() public void Setup()
{ {
RecurringJob.AddOrUpdate(() => EmbyContentSync.Start(), Cron.Hourly(5)); RecurringJob.AddOrUpdate(() => EmbyContentSync.Start(), Cron.Hourly(5));
RecurringJob.AddOrUpdate(() => SonarrCacher.Start(), Cron.Hourly(10)); RecurringJob.AddOrUpdate(() => SonarrSync.Start(), Cron.Hourly(10));
RecurringJob.AddOrUpdate(() => RadarrCacher.CacheContent(), Cron.Hourly(15)); RecurringJob.AddOrUpdate(() => RadarrSync.CacheContent(), Cron.Hourly(15));
RecurringJob.AddOrUpdate(() => PlexContentSync.CacheContent(), Cron.Hourly(20)); RecurringJob.AddOrUpdate(() => PlexContentSync.CacheContent(), Cron.Hourly(20));
RecurringJob.AddOrUpdate(() => CpCache.Start(), Cron.Hourly(30)); RecurringJob.AddOrUpdate(() => CpCache.Start(), Cron.Hourly(30));

@ -39,10 +39,10 @@ using Ombi.Store.Entities;
namespace Ombi.Schedule.Jobs.Couchpotato namespace Ombi.Schedule.Jobs.Couchpotato
{ {
public class CouchPotatoCacher : ICouchPotatoCacher public class CouchPotatoSync : ICouchPotatoSync
{ {
public CouchPotatoCacher(ISettingsService<CouchPotatoSettings> cpSettings, public CouchPotatoSync(ISettingsService<CouchPotatoSettings> cpSettings,
ICouchPotatoApi api, ILogger<CouchPotatoCacher> log, IOmbiContext ctx) ICouchPotatoApi api, ILogger<CouchPotatoSync> log, IOmbiContext ctx)
{ {
_settings = cpSettings; _settings = cpSettings;
_api = api; _api = api;
@ -52,7 +52,7 @@ namespace Ombi.Schedule.Jobs.Couchpotato
private readonly ISettingsService<CouchPotatoSettings> _settings; private readonly ISettingsService<CouchPotatoSettings> _settings;
private readonly ICouchPotatoApi _api; private readonly ICouchPotatoApi _api;
private readonly ILogger<CouchPotatoCacher> _log; private readonly ILogger<CouchPotatoSync> _log;
private readonly IOmbiContext _ctx; private readonly IOmbiContext _ctx;
public async Task Start() public async Task Start()

@ -2,7 +2,7 @@
namespace Ombi.Schedule.Jobs.Couchpotato namespace Ombi.Schedule.Jobs.Couchpotato
{ {
public interface ICouchPotatoCacher public interface ICouchPotatoSync
{ {
Task Start(); Task Start();
} }

@ -4,7 +4,7 @@ using Ombi.Store.Entities;
namespace Ombi.Schedule.Jobs.Radarr namespace Ombi.Schedule.Jobs.Radarr
{ {
public interface IRadarrCacher public interface IRadarrSync
{ {
Task CacheContent(); Task CacheContent();
Task<IEnumerable<RadarrCache>> GetCachedContent(); Task<IEnumerable<RadarrCache>> GetCachedContent();

@ -14,9 +14,9 @@ using Serilog;
namespace Ombi.Schedule.Jobs.Radarr namespace Ombi.Schedule.Jobs.Radarr
{ {
public class RadarrCacher : IRadarrCacher public class RadarrSync : IRadarrSync
{ {
public RadarrCacher(ISettingsService<RadarrSettings> radarr, IRadarrApi radarrApi, ILogger<RadarrCacher> log, IOmbiContext ctx) public RadarrSync(ISettingsService<RadarrSettings> radarr, IRadarrApi radarrApi, ILogger<RadarrSync> log, IOmbiContext ctx)
{ {
RadarrSettings = radarr; RadarrSettings = radarr;
RadarrApi = radarrApi; RadarrApi = radarrApi;
@ -26,7 +26,7 @@ namespace Ombi.Schedule.Jobs.Radarr
private ISettingsService<RadarrSettings> RadarrSettings { get; } private ISettingsService<RadarrSettings> RadarrSettings { get; }
private IRadarrApi RadarrApi { get; } private IRadarrApi RadarrApi { get; }
private ILogger<RadarrCacher> Logger { get; } private ILogger<RadarrSync> Logger { get; }
private readonly IOmbiContext _ctx; private readonly IOmbiContext _ctx;
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1); private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);

@ -2,7 +2,7 @@
namespace Ombi.Schedule.Jobs.Sonarr namespace Ombi.Schedule.Jobs.Sonarr
{ {
public interface ISonarrCacher public interface ISonarrSync
{ {
Task Start(); Task Start();
} }

@ -16,9 +16,9 @@ using Ombi.Store.Entities;
namespace Ombi.Schedule.Jobs.Sonarr namespace Ombi.Schedule.Jobs.Sonarr
{ {
public class SonarrCacher : ISonarrCacher public class SonarrSync : ISonarrSync
{ {
public SonarrCacher(ISettingsService<SonarrSettings> s, ISonarrApi api, ILogger<SonarrCacher> l, IOmbiContext ctx) public SonarrSync(ISettingsService<SonarrSettings> s, ISonarrApi api, ILogger<SonarrSync> l, IOmbiContext ctx)
{ {
_settings = s; _settings = s;
_api = api; _api = api;
@ -28,7 +28,7 @@ namespace Ombi.Schedule.Jobs.Sonarr
private readonly ISettingsService<SonarrSettings> _settings; private readonly ISettingsService<SonarrSettings> _settings;
private readonly ISonarrApi _api; private readonly ISonarrApi _api;
private readonly ILogger<SonarrCacher> _log; private readonly ILogger<SonarrSync> _log;
private readonly IOmbiContext _ctx; private readonly IOmbiContext _ctx;
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1); private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);

@ -2,6 +2,8 @@
{ {
public class JobSettings public class JobSettings
{ {
public string EmbyContentSync { get; set; }
public string SonarrSync { get; set; }
public string RadarrSync { get; set; }
} }
} }

@ -44,14 +44,14 @@ namespace Ombi.Controllers
/// <param name="mapper">The mapper.</param> /// <param name="mapper">The mapper.</param>
/// <param name="templateRepo">The templateRepo.</param> /// <param name="templateRepo">The templateRepo.</param>
/// <param name="embyApi">The embyApi.</param> /// <param name="embyApi">The embyApi.</param>
/// <param name="radarrCacher">The radarrCacher.</param> /// <param name="radarrSync">The radarrCacher.</param>
/// <param name="memCache">The memory cache.</param> /// <param name="memCache">The memory cache.</param>
/// <param name="githubApi">The memory cache.</param> /// <param name="githubApi">The memory cache.</param>
public SettingsController(ISettingsResolver resolver, public SettingsController(ISettingsResolver resolver,
IMapper mapper, IMapper mapper,
INotificationTemplatesRepository templateRepo, INotificationTemplatesRepository templateRepo,
IEmbyApi embyApi, IEmbyApi embyApi,
IRadarrCacher radarrCacher, IRadarrSync radarrSync,
IMemoryCache memCache, IMemoryCache memCache,
IGithubApi githubApi) IGithubApi githubApi)
{ {
@ -59,7 +59,7 @@ namespace Ombi.Controllers
Mapper = mapper; Mapper = mapper;
TemplateRepository = templateRepo; TemplateRepository = templateRepo;
_embyApi = embyApi; _embyApi = embyApi;
_radarrCacher = radarrCacher; _radarrSync = radarrSync;
_cache = memCache; _cache = memCache;
_githubApi = githubApi; _githubApi = githubApi;
} }
@ -68,7 +68,7 @@ namespace Ombi.Controllers
private IMapper Mapper { get; } private IMapper Mapper { get; }
private INotificationTemplatesRepository TemplateRepository { get; } private INotificationTemplatesRepository TemplateRepository { get; }
private readonly IEmbyApi _embyApi; private readonly IEmbyApi _embyApi;
private readonly IRadarrCacher _radarrCacher; private readonly IRadarrSync _radarrSync;
private readonly IMemoryCache _cache; private readonly IMemoryCache _cache;
private readonly IGithubApi _githubApi; private readonly IGithubApi _githubApi;
@ -332,7 +332,7 @@ namespace Ombi.Controllers
{ {
_cache.Remove(CacheKeys.RadarrRootProfiles); _cache.Remove(CacheKeys.RadarrRootProfiles);
_cache.Remove(CacheKeys.RadarrQualityProfiles); _cache.Remove(CacheKeys.RadarrQualityProfiles);
BackgroundJob.Enqueue(() => _radarrCacher.CacheContent()); BackgroundJob.Enqueue(() => _radarrSync.CacheContent());
} }
return result; return result;
} }

Loading…
Cancel
Save