From 4926255094ae3ac26b57052e5d2f1aee60f875c1 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 18 Jan 2017 21:05:08 +0000 Subject: [PATCH] Finished #923 !!! --- Ombi.Api.Models/Radarr/RadarrAddMovie.cs | 5 + Ombi.Api/RadarrApi.cs | 4 +- Ombi.Core/CacheKeys.cs | 1 + Ombi.Core/MovieSender.cs | 30 +++++- .../SettingModels/ScheduledJobsSettings.cs | 1 + Ombi.Services/Interfaces/IRadarrCacher.cs | 11 ++ Ombi.Services/Jobs/JobNames.cs | 1 + Ombi.Services/Jobs/RadarrCacher.cs | 102 ++++++++++++++++++ Ombi.Services/Ombi.Services.csproj | 2 + Ombi.UI/Jobs/Scheduler.cs | 14 +++ Ombi.UI/Modules/Admin/AdminModule.cs | 54 +++++++--- Ombi.UI/Modules/Admin/IntegrationModule.cs | 12 +++ Ombi.UI/Modules/SearchModule.cs | 13 ++- Ombi.UI/NinjectModules/ServicesModule.cs | 1 + Ombi.UI/Ombi.UI.csproj | 1 + Ombi.UI/Validators/RadarrValidator.cs | 43 ++++++++ Ombi.UI/Views/Admin/Radarr.cshtml | 2 +- Ombi.UI/Views/Admin/SchedulerSettings.cshtml | 8 ++ 18 files changed, 283 insertions(+), 22 deletions(-) create mode 100644 Ombi.Services/Interfaces/IRadarrCacher.cs create mode 100644 Ombi.Services/Jobs/RadarrCacher.cs create mode 100644 Ombi.UI/Validators/RadarrValidator.cs diff --git a/Ombi.Api.Models/Radarr/RadarrAddMovie.cs b/Ombi.Api.Models/Radarr/RadarrAddMovie.cs index 7c2000985..5c589bd12 100644 --- a/Ombi.Api.Models/Radarr/RadarrAddMovie.cs +++ b/Ombi.Api.Models/Radarr/RadarrAddMovie.cs @@ -34,6 +34,10 @@ namespace Ombi.Api.Models.Radarr public class RadarrAddMovie { + public RadarrAddMovie() + { + images = new List(); + } public RadarrError Error { get; set; } public RadarrAddOptions addOptions { get; set; } public string title { get; set; } @@ -41,6 +45,7 @@ namespace Ombi.Api.Models.Radarr public int qualityProfileId { get; set; } public bool monitored { get; set; } public int tmdbId { get; set; } + public List images { get; set; } public string cleanTitle { get; set; } public string imdbId { get; set; } public string titleSlug { get; set; } diff --git a/Ombi.Api/RadarrApi.cs b/Ombi.Api/RadarrApi.cs index 92bb0435b..648ff87b3 100644 --- a/Ombi.Api/RadarrApi.cs +++ b/Ombi.Api/RadarrApi.cs @@ -77,8 +77,8 @@ namespace Ombi.Api tmdbId = tmdbId, qualityProfileId = qualityId, rootFolderPath = rootPath, - titleSlug = title - + titleSlug = title, + monitored = true }; if (searchNow) diff --git a/Ombi.Core/CacheKeys.cs b/Ombi.Core/CacheKeys.cs index 5e6e6c1f3..889ac6df7 100644 --- a/Ombi.Core/CacheKeys.cs +++ b/Ombi.Core/CacheKeys.cs @@ -39,6 +39,7 @@ namespace Ombi.Core public const string SonarrQualityProfiles = nameof(SonarrQualityProfiles); public const string RadarrQualityProfiles = nameof(RadarrQualityProfiles); public const string SonarrQueued = nameof(SonarrQueued); + public const string RadarrMovies = nameof(RadarrMovies); public const string SickRageQualityProfiles = nameof(SickRageQualityProfiles); public const string SickRageQueued = nameof(SickRageQueued); public const string CouchPotatoQualityProfiles = nameof(CouchPotatoQualityProfiles); diff --git a/Ombi.Core/MovieSender.cs b/Ombi.Core/MovieSender.cs index 39e2e0554..cf5b4fda3 100644 --- a/Ombi.Core/MovieSender.cs +++ b/Ombi.Core/MovieSender.cs @@ -37,16 +37,20 @@ namespace Ombi.Core public class MovieSender : IMovieSender { public MovieSender(ISettingsService cp, ISettingsService watcher, - ICouchPotatoApi cpApi, IWatcherApi watcherApi) + ICouchPotatoApi cpApi, IWatcherApi watcherApi, IRadarrApi radarrApi, ISettingsService radarrSettings) { CouchPotatoSettings = cp; WatcherSettings = watcher; CpApi = cpApi; WatcherApi = watcherApi; + RadarrSettings = radarrSettings; + RadarrApi = radarrApi; } private ISettingsService CouchPotatoSettings { get; } private ISettingsService WatcherSettings { get; } + private ISettingsService RadarrSettings { get; } + private IRadarrApi RadarrApi { get; } private ICouchPotatoApi CpApi { get; } private IWatcherApi WatcherApi { get; } private static Logger Log = LogManager.GetCurrentClassLogger(); @@ -55,6 +59,7 @@ namespace Ombi.Core { var cpSettings = await CouchPotatoSettings.GetSettingsAsync(); var watcherSettings = await WatcherSettings.GetSettingsAsync(); + var radarrSettings = await RadarrSettings.GetSettingsAsync(); if (cpSettings.Enabled) { @@ -66,6 +71,11 @@ namespace Ombi.Core return SendToWatcher(model, watcherSettings); } + if (radarrSettings.Enabled) + { + return SendToRadarr(model, radarrSettings); + } + return new MovieSenderResult { Result = false, MovieSendingEnabled = false }; } @@ -91,5 +101,23 @@ namespace Ombi.Core var result = CpApi.AddMovie(model.ImdbId, settings.ApiKey, model.Title, settings.FullUri, qualityId); return new MovieSenderResult { Result = result, MovieSendingEnabled = true }; } + + private MovieSenderResult SendToRadarr(RequestedModel model, RadarrSettings settings) + { + var qualityProfile = 0; + int.TryParse(settings.QualityProfile, out qualityProfile); + var result = RadarrApi.AddMovie(model.ProviderId, model.Title, qualityProfile, settings.RootPath, settings.ApiKey, settings.FullUri, true); + + if (!string.IsNullOrEmpty(result.Error?.message)) + { + Log.Error(result.Error.message); + return new MovieSenderResult { Result = false }; + } + if (!string.IsNullOrEmpty(result.title)) + { + return new MovieSenderResult { Result = true, MovieSendingEnabled = true }; + } + return new MovieSenderResult { Result = false, MovieSendingEnabled = true }; + } } } \ No newline at end of file diff --git a/Ombi.Core/SettingModels/ScheduledJobsSettings.cs b/Ombi.Core/SettingModels/ScheduledJobsSettings.cs index 76921a679..a2609206b 100644 --- a/Ombi.Core/SettingModels/ScheduledJobsSettings.cs +++ b/Ombi.Core/SettingModels/ScheduledJobsSettings.cs @@ -46,5 +46,6 @@ namespace Ombi.Core.SettingModels public int FaultQueueHandler { get; set; } public int PlexContentCacher { get; set; } public int PlexUserChecker { get; set; } + public int RadarrCacher { get; set; } } } \ No newline at end of file diff --git a/Ombi.Services/Interfaces/IRadarrCacher.cs b/Ombi.Services/Interfaces/IRadarrCacher.cs new file mode 100644 index 000000000..85b2fae38 --- /dev/null +++ b/Ombi.Services/Interfaces/IRadarrCacher.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using Ombi.Services.Models; + +namespace Ombi.Services.Interfaces +{ + public interface IRadarrCacher + { + void Queued(); + int[] QueuedIds(); + } +} diff --git a/Ombi.Services/Jobs/JobNames.cs b/Ombi.Services/Jobs/JobNames.cs index 06b5b32ac..8b663a8ae 100644 --- a/Ombi.Services/Jobs/JobNames.cs +++ b/Ombi.Services/Jobs/JobNames.cs @@ -32,6 +32,7 @@ namespace Ombi.Services.Jobs public const string CpCacher = "CouchPotato Cacher"; public const string WatcherCacher = "Watcher Cacher"; public const string SonarrCacher = "Sonarr Cacher"; + public const string RadarrCacher = "Radarr Cacher"; public const string SrCacher = "SickRage Cacher"; public const string PlexChecker = "Plex Availability Cacher"; public const string PlexCacher = "Plex Cacher"; diff --git a/Ombi.Services/Jobs/RadarrCacher.cs b/Ombi.Services/Jobs/RadarrCacher.cs new file mode 100644 index 000000000..7273fb626 --- /dev/null +++ b/Ombi.Services/Jobs/RadarrCacher.cs @@ -0,0 +1,102 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: PlexAvailabilityChecker.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion + +using System.Collections.Generic; +using System.Linq; +using NLog; +using Ombi.Api.Interfaces; +using Ombi.Api.Models.Radarr; +using Ombi.Core; +using Ombi.Core.SettingModels; +using Ombi.Helpers; +using Ombi.Services.Interfaces; +using Quartz; + +namespace Ombi.Services.Jobs +{ + public class RadarrCacher : IJob, IRadarrCacher + { + public RadarrCacher(ISettingsService radarrService, IRadarrApi radarrApi, ICacheProvider cache, IJobRecord rec) + { + RadarrSettings = radarrService; + RadarrApi = radarrApi; + Job = rec; + Cache = cache; + } + + private ISettingsService RadarrSettings { get; } + private ICacheProvider Cache { get; } + private IRadarrApi RadarrApi { get; } + private IJobRecord Job { get; } + + private static Logger Log = LogManager.GetCurrentClassLogger(); + + public void Queued() + { + var settings = RadarrSettings.GetSettings(); + if (settings.Enabled) + { + Job.SetRunning(true, JobNames.RadarrCacher); + try + { + var movies = RadarrApi.GetMovies(settings.ApiKey, settings.FullUri); + if (movies != null) + { + var movieIds = movies.Select(x => x.tmdbId).ToList(); + Cache.Set(CacheKeys.RadarrMovies, movieIds, CacheKeys.TimeFrameMinutes.SchedulerCaching); + } + } + catch (System.Exception ex) + { + Log.Error(ex, "Failed caching queued items from Radarr"); + } + finally + { + Job.Record(JobNames.RadarrCacher); + Job.SetRunning(false, JobNames.RadarrCacher); + } + } + } + + // we do not want to set here... + public int[] QueuedIds() + { + var retVal = new List(); + var movies = Cache.Get>(CacheKeys.RadarrMovies); + if (movies != null) + { + retVal.AddRange(movies); + } + return retVal.ToArray(); + } + + public void Execute(IJobExecutionContext context) + { + Queued(); + } + } +} \ No newline at end of file diff --git a/Ombi.Services/Ombi.Services.csproj b/Ombi.Services/Ombi.Services.csproj index ec412e87f..444f86980 100644 --- a/Ombi.Services/Ombi.Services.csproj +++ b/Ombi.Services/Ombi.Services.csproj @@ -86,9 +86,11 @@ + + diff --git a/Ombi.UI/Jobs/Scheduler.cs b/Ombi.UI/Jobs/Scheduler.cs index 7450e1c86..b2c32188a 100644 --- a/Ombi.UI/Jobs/Scheduler.cs +++ b/Ombi.UI/Jobs/Scheduler.cs @@ -75,6 +75,7 @@ namespace Ombi.UI.Jobs JobBuilder.Create().WithIdentity("UserRequestLimiter", "Request").Build(), JobBuilder.Create().WithIdentity("RecentlyAddedModel", "Email").Build(), JobBuilder.Create().WithIdentity("FaultQueueHandler", "Fault").Build(), + JobBuilder.Create().WithIdentity("RadarrCacher", "Cache").Build(), }; jobs.AddRange(jobList); @@ -170,6 +171,10 @@ namespace Ombi.UI.Jobs { s.PlexUserChecker = 24; } + if (s.RadarrCacher == 0) + { + s.RadarrCacher = 60; + } var triggers = new List(); @@ -222,6 +227,14 @@ namespace Ombi.UI.Jobs .WithSimpleSchedule(x => x.WithIntervalInMinutes(s.WatcherCacher).RepeatForever()) .Build(); + var radarrCacher = + TriggerBuilder.Create() + .WithIdentity("RadarrCacher", "Cache") + .StartNow() + //.StartAt(DateBuilder.FutureDate(2, IntervalUnit.Minute)) + .WithSimpleSchedule(x => x.WithIntervalInMinutes(s.RadarrCacher).RepeatForever()) + .Build(); + var storeBackup = TriggerBuilder.Create() .WithIdentity("StoreBackup", "Database") @@ -280,6 +293,7 @@ namespace Ombi.UI.Jobs triggers.Add(fault); triggers.Add(plexCacher); triggers.Add(plexUserChecker); + triggers.Add(radarrCacher); return triggers; } diff --git a/Ombi.UI/Modules/Admin/AdminModule.cs b/Ombi.UI/Modules/Admin/AdminModule.cs index 81b0f8422..06533b7d3 100644 --- a/Ombi.UI/Modules/Admin/AdminModule.cs +++ b/Ombi.UI/Modules/Admin/AdminModule.cs @@ -175,7 +175,7 @@ namespace Ombi.UI.Modules.Admin Get["/getusers"] = _ => GetUsers(); Get["/couchpotato"] = _ => CouchPotato(); - Post["/couchpotato"] = _ => SaveCouchPotato(); + Post["/couchpotato", true] = async (x, ct) => await SaveCouchPotato(); Get["/plex"] = _ => Plex(); Post["/plex", true] = async (x, ct) => await SavePlex(); @@ -185,7 +185,7 @@ namespace Ombi.UI.Modules.Admin Post["/sonarrprofiles"] = _ => GetSonarrQualityProfiles(); Get["/radarr", true] = async (x, ct) => await Radarr(); - Post["/radarr"] = _ => SaveRadarr(); + Post["/radarr", true] = async (x, ct) => await SaveRadarr(); Post["/radarrprofiles"] = _ => GetRadarrQualityProfiles(); Get["/sickrage"] = _ => Sickrage(); @@ -385,7 +385,7 @@ namespace Ombi.UI.Modules.Admin return View["CouchPotato", settings]; } - private Response SaveCouchPotato() + private async Task SaveCouchPotato() { var couchPotatoSettings = this.Bind(); var valid = this.Validate(couchPotatoSettings); @@ -394,7 +394,7 @@ namespace Ombi.UI.Modules.Admin return Response.AsJson(valid.SendJsonError()); } - var watcherSettings = WatcherSettings.GetSettings(); + var watcherSettings = await WatcherSettings.GetSettingsAsync(); if (watcherSettings.Enabled) { @@ -406,8 +406,20 @@ namespace Ombi.UI.Modules.Admin }); } + var radarrSettings = await RadarrSettings.GetSettingsAsync(); + + if (radarrSettings.Enabled) + { + return + Response.AsJson(new JsonResponseModel + { + Result = false, + Message = "Cannot have Radarr and CouchPotato both enabled." + }); + } + couchPotatoSettings.ApiKey = couchPotatoSettings.ApiKey.Trim(); - var result = CpService.SaveSettings(couchPotatoSettings); + var result = await CpService.SaveSettingsAsync(couchPotatoSettings); return Response.AsJson(result ? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for CouchPotato!" } : new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." }); @@ -465,6 +477,7 @@ namespace Ombi.UI.Modules.Admin { return Response.AsJson(new JsonResponseModel { Result = false, Message = "SickRage is enabled, we cannot enable Sonarr and SickRage" }); } + sonarrSettings.ApiKey = sonarrSettings.ApiKey.Trim(); var result = SonarrService.SaveSettings(sonarrSettings); @@ -480,25 +493,34 @@ namespace Ombi.UI.Modules.Admin return View["Radarr", settings]; } - private Response SaveRadarr() + private async Task SaveRadarr() { - var sonarrSettings = this.Bind(); + var radarrSettings = this.Bind(); - var valid = this.Validate(sonarrSettings); - if (!valid.IsValid) + //Check Watcher and CP make sure they are not enabled + var watcher = await WatcherSettings.GetSettingsAsync(); + if (watcher.Enabled) { - return Response.AsJson(valid.SendJsonError()); + return Response.AsJson(new JsonResponseModel { Result = false, Message = "Watcher is enabled, we cannot enable Watcher and Radarr" }); } - var sickRageEnabled = SickRageService.GetSettings().Enabled; - if (sickRageEnabled) + + var cp = await CpService.GetSettingsAsync(); + if (cp.Enabled) { - return Response.AsJson(new JsonResponseModel { Result = false, Message = "SickRage is enabled, we cannot enable Sonarr and SickRage" }); + return Response.AsJson(new JsonResponseModel { Result = false, Message = "CouchPotato is enabled, we cannot enable Watcher and CouchPotato" }); } - sonarrSettings.ApiKey = sonarrSettings.ApiKey.Trim(); - var result = SonarrService.SaveSettings(sonarrSettings); + + var valid = this.Validate(radarrSettings); + if (!valid.IsValid) + { + return Response.AsJson(valid.SendJsonError()); + } + + radarrSettings.ApiKey = radarrSettings.ApiKey.Trim(); + var result = await RadarrSettings.SaveSettingsAsync(radarrSettings); return Response.AsJson(result - ? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Sonarr!" } + ? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Radarr!" } : new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." }); } diff --git a/Ombi.UI/Modules/Admin/IntegrationModule.cs b/Ombi.UI/Modules/Admin/IntegrationModule.cs index 9cc718e40..b8a91e520 100644 --- a/Ombi.UI/Modules/Admin/IntegrationModule.cs +++ b/Ombi.UI/Modules/Admin/IntegrationModule.cs @@ -97,6 +97,18 @@ namespace Ombi.UI.Modules.Admin }); } + var watcherSettings = await WatcherSettings.GetSettingsAsync(); + + if (watcherSettings.Enabled) + { + return + Response.AsJson(new JsonResponseModel + { + Result = false, + Message = "Cannot have Watcher and CouchPotato both enabled." + }); + } + settings.ApiKey = settings.ApiKey.Trim(); var result = await WatcherSettings.SaveSettingsAsync(settings); return Response.AsJson(result diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index 30acdf68a..b64b586f8 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -76,7 +76,7 @@ namespace Ombi.UI.Modules ISettingsService plexService, ISettingsService auth, IRepository u, ISettingsService email, IIssueService issue, IAnalytics a, IRepository rl, ITransientFaultQueue tfQueue, IRepository content, - ISecurityExtensions security, IMovieSender movieSender) + ISecurityExtensions security, IMovieSender movieSender, IRadarrCacher radarrCacher) : base("search", prSettings, security) { Auth = auth; @@ -108,6 +108,7 @@ namespace Ombi.UI.Modules PlexContentRepository = content; MovieSender = movieSender; WatcherCacher = watcherCacher; + RadarrCacher = radarrCacher; Get["SearchIndex", "/", true] = async (x, ct) => await RequestLoad(); @@ -157,6 +158,7 @@ namespace Ombi.UI.Modules private IAnalytics Analytics { get; } private ITransientFaultQueue FaultQueue { get; } private IRepository RequestLimitRepo { get; } + private IRadarrCacher RadarrCacher { get; } private static Logger Log = LogManager.GetCurrentClassLogger(); private async Task RequestLoad() @@ -236,6 +238,7 @@ namespace Ombi.UI.Modules var cpCached = CpCacher.QueuedIds(); var watcherCached = WatcherCacher.QueuedIds(); + var radarrCached = RadarrCacher.QueuedIds(); var content = PlexContentRepository.GetAll(); var plexMovies = Checker.GetPlexMovies(content); var viewMovies = new List(); @@ -288,13 +291,19 @@ namespace Ombi.UI.Modules } else if (cpCached.Contains(movie.Id) && canSee) // compare to the couchpotato db { + viewMovie.Approved = true; viewMovie.Requested = true; } else if(watcherCached.Contains(imdbId) && canSee) // compare to the watcher db { + viewMovie.Approved = true; + viewMovie.Requested = true; + } + else if (radarrCached.Contains(movie.Id) && canSee) + { + viewMovie.Approved = true; viewMovie.Requested = true; } - viewMovies.Add(viewMovie); } diff --git a/Ombi.UI/NinjectModules/ServicesModule.cs b/Ombi.UI/NinjectModules/ServicesModule.cs index 7c5f9095a..3b02a0213 100644 --- a/Ombi.UI/NinjectModules/ServicesModule.cs +++ b/Ombi.UI/NinjectModules/ServicesModule.cs @@ -48,6 +48,7 @@ namespace Ombi.UI.NinjectModules Bind().To(); Bind().To(); Bind().To(); + Bind().To(); Bind().To(); Bind().To(); Bind().To(); diff --git a/Ombi.UI/Ombi.UI.csproj b/Ombi.UI/Ombi.UI.csproj index 524d11c81..ce3f1453b 100644 --- a/Ombi.UI/Ombi.UI.csproj +++ b/Ombi.UI/Ombi.UI.csproj @@ -288,6 +288,7 @@ + diff --git a/Ombi.UI/Validators/RadarrValidator.cs b/Ombi.UI/Validators/RadarrValidator.cs new file mode 100644 index 000000000..75550c787 --- /dev/null +++ b/Ombi.UI/Validators/RadarrValidator.cs @@ -0,0 +1,43 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: SonarrValidator.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion + +using FluentValidation; +using Ombi.Core.SettingModels; + +namespace Ombi.UI.Validators +{ + public class RadarrValidator : AbstractValidator + { + public RadarrValidator() + { + RuleFor(request => request.ApiKey).NotEmpty().WithMessage("You must specify a Api Key."); + RuleFor(request => request.Ip).NotEmpty().WithMessage("You must specify a IP/Host name."); + RuleFor(request => request.Port).NotEmpty().WithMessage("You must specify a Port."); + RuleFor(request => request.QualityProfile).NotEmpty().WithMessage("You must specify a Quality Profile."); + } + } +} \ No newline at end of file diff --git a/Ombi.UI/Views/Admin/Radarr.cshtml b/Ombi.UI/Views/Admin/Radarr.cshtml index e0ce08d07..3d4520e68 100644 --- a/Ombi.UI/Views/Admin/Radarr.cshtml +++ b/Ombi.UI/Views/Admin/Radarr.cshtml @@ -73,7 +73,7 @@
- +
diff --git a/Ombi.UI/Views/Admin/SchedulerSettings.cshtml b/Ombi.UI/Views/Admin/SchedulerSettings.cshtml index 0c0b0200a..9ba6ed904 100644 --- a/Ombi.UI/Views/Admin/SchedulerSettings.cshtml +++ b/Ombi.UI/Views/Admin/SchedulerSettings.cshtml @@ -45,6 +45,14 @@ +
+ + +
+
+ + +
Please note, the minimum time for this to run is 11 hours, if set below 11 then we will ignore that value. This is a very resource intensive job, the less we run it the better.