Added a switch to use the new search or not, just in case people do not like it.

added a migration to turn on the new search.
This commit is contained in:
Jamie.Rees 2017-01-27 08:42:44 +00:00
parent 16c94f2414
commit b2417d8477
10 changed files with 176 additions and 42 deletions

View file

@ -77,7 +77,7 @@ namespace Ombi.UI.Modules
ISettingsService<PlexSettings> plexService, ISettingsService<AuthenticationSettings> auth,
IRepository<UsersToNotify> u, ISettingsService<EmailNotificationSettings> email,
IIssueService issue, IAnalytics a, IRepository<RequestLimit> rl, ITransientFaultQueue tfQueue, IRepository<PlexContent> content,
ISecurityExtensions security, IMovieSender movieSender, IRadarrCacher radarrCacher, ITraktApi traktApi)
ISecurityExtensions security, IMovieSender movieSender, IRadarrCacher radarrCacher, ITraktApi traktApi, ISettingsService<CustomizationSettings> cus)
: base("search", prSettings, security)
{
Auth = auth;
@ -111,6 +111,7 @@ namespace Ombi.UI.Modules
WatcherCacher = watcherCacher;
RadarrCacher = radarrCacher;
TraktApi = traktApi;
CustomizationSettings = cus;
Get["SearchIndex", "/", true] = async (x, ct) => await RequestLoad();
@ -169,14 +170,22 @@ namespace Ombi.UI.Modules
private ITransientFaultQueue FaultQueue { get; }
private IRepository<RequestLimit> RequestLimitRepo { get; }
private IRadarrCacher RadarrCacher { get; }
private ISettingsService<CustomizationSettings> CustomizationSettings { get; }
private static Logger Log = LogManager.GetCurrentClassLogger();
private async Task<Negotiator> RequestLoad()
{
var settings = await PrService.GetSettingsAsync();
var custom = await CustomizationSettings.GetSettingsAsync();
var searchViewModel = new SearchLoadViewModel
{
Settings = settings,
CustomizationSettings = custom
};
return View["Search/Index", settings];
return View["Search/Index", searchViewModel];
}
private async Task<Response> UpcomingMovies()