Short circuit when Plex hasn't been setup. Added Miniprofiler

This commit is contained in:
tidusjar 2016-08-04 13:38:42 +01:00
parent 0f34885444
commit 5d18877b49
8 changed files with 86 additions and 5 deletions

View file

@ -44,6 +44,8 @@ using PlexRequests.Helpers;
using PlexRequests.Helpers.Analytics;
using PlexRequests.UI.Models;
using StackExchange.Profiling;
using Action = PlexRequests.Helpers.Analytics.Action;
namespace PlexRequests.UI.Modules
@ -76,8 +78,17 @@ namespace PlexRequests.UI.Modules
public async Task<Negotiator> Index()
{
var settings = await AuthService.GetSettingsAsync();
return View["Index", settings];
var profiler = MiniProfiler.Current;
using (profiler.Step("Loading Index"))
{
using (profiler.Step("Loading AuthSettingsAsync and returning View"))
{
var settings = await AuthService.GetSettingsAsync();
return View["Index", settings];
}
}
}
private async Task<Response> LoginUser()