Added progress reporting to kernel.init

pull/702/head
LukePulverenti Luke Pulverenti luke pulverenti 13 years ago
parent c3d835cfc5
commit 00545b5543

@ -52,10 +52,13 @@ namespace MediaBrowser.Common.Kernel
{
ReloadLogger();
progress.Report(new TaskProgress() { Description = "Loading configuration", PercentComplete = 0 });
ReloadConfiguration();
progress.Report(new TaskProgress() { Description = "Starting Http server", PercentComplete = 5 });
ReloadHttpServer();
progress.Report(new TaskProgress() { Description = "Loading Plugins", PercentComplete = 10 });
ReloadComposableParts();
}

@ -16,6 +16,7 @@ using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Users;
using MediaBrowser.Model.Progress;
namespace MediaBrowser.Controller
{
@ -59,6 +60,19 @@ namespace MediaBrowser.Controller
ItemController.BeginResolvePath += ItemController_BeginResolvePath;
}
public override void Init(IProgress<TaskProgress> progress)
{
base.Init(progress);
progress.Report(new TaskProgress() { Description = "Loading Users", PercentComplete = 15 });
ReloadUsers();
progress.Report(new TaskProgress() { Description = "Loading Media Library", PercentComplete = 20 });
ReloadRoot();
progress.Report(new TaskProgress() { Description = "Loading Complete", PercentComplete = 100 });
}
protected override void OnComposablePartsLoaded()
{
List<IBaseItemResolver> resolvers = EntityResolvers.ToList();
@ -72,10 +86,6 @@ namespace MediaBrowser.Controller
// The base class will start up all the plugins
base.OnComposablePartsLoaded();
// Get users from users folder
// Load root media folder
Parallel.Invoke(ReloadUsers, ReloadRoot);
}
/// <summary>

Loading…
Cancel
Save