| 
														
															@@ -11,13 +11,14 @@ using MediaBrowser.Common.Json; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 using MediaBrowser.Common.Logging;
 
														 | 
														
														 | 
														
															 using MediaBrowser.Common.Logging;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 using MediaBrowser.Common.Net;
 
														 | 
														
														 | 
														
															 using MediaBrowser.Common.Net;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 using MediaBrowser.Common.Plugins;
 
														 | 
														
														 | 
														
															 using MediaBrowser.Common.Plugins;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+using MediaBrowser.Common.Progress;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 namespace MediaBrowser.Common.Kernel
 
														 | 
														
														 | 
														
															 namespace MediaBrowser.Common.Kernel
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 {
 
														 | 
														
														 | 
														
															 {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /// <summary>
 
														 | 
														
														 | 
														
															     /// <summary>
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /// Represents a shared base kernel for both the UI and server apps
 
														 | 
														
														 | 
														
															     /// Represents a shared base kernel for both the UI and server apps
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /// </summary>
 
														 | 
														
														 | 
														
															     /// </summary>
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public abstract class BaseKernel<TConfigurationType>
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public abstract class BaseKernel<TConfigurationType> : IDisposable
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         where TConfigurationType : BaseApplicationConfiguration, new()
 
														 | 
														
														 | 
														
															         where TConfigurationType : BaseApplicationConfiguration, new()
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     {
 
														 | 
														
														 | 
														
															     {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         /// <summary>
 
														 | 
														
														 | 
														
															         /// <summary>
 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -76,12 +77,12 @@ namespace MediaBrowser.Common.Kernel 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Logger.LoggerInstance = new FileLogger(Path.Combine(ProgramDataPath, "Logs"));
 
														 | 
														
														 | 
														
															             Logger.LoggerInstance = new FileLogger(Path.Combine(ProgramDataPath, "Logs"));
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         }
 
														 | 
														
														 | 
														
															         }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        public virtual void Init()
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        public virtual void Init(IProgress<TaskProgress> progress)
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         {
 
														 | 
														
														 | 
														
															         {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ReloadConfiguration();
 
														 | 
														
														 | 
														
															             ReloadConfiguration();
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ReloadHttpServer();
 
														 | 
														
														 | 
														
															             ReloadHttpServer();
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             ReloadComposableParts();
 
														 | 
														
														 | 
														
															             ReloadComposableParts();
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         }
 
														 | 
														
														 | 
														
															         }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -206,13 +207,18 @@ namespace MediaBrowser.Common.Kernel 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         /// Restarts the Http Server, or starts it if not currently running
 
														 | 
														
														 | 
														
															         /// Restarts the Http Server, or starts it if not currently running
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         /// </summary>
 
														 | 
														
														 | 
														
															         /// </summary>
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         private void ReloadHttpServer()
 
														 | 
														
														 | 
														
															         private void ReloadHttpServer()
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            DisposeHttpServer();
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            HttpServer = new HttpServer("http://+:" + Configuration.HttpServerPortNumber + "/mediabrowser/");
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        private void DisposeHttpServer()
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         {
 
														 | 
														
														 | 
														
															         {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (HttpServer != null)
 
														 | 
														
														 | 
														
															             if (HttpServer != null)
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             {
 
														 | 
														
														 | 
														
															             {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 HttpServer.Dispose();
 
														 | 
														
														 | 
														
															                 HttpServer.Dispose();
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             }
 
														 | 
														
														 | 
														
															             }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            HttpServer = new HttpServer("http://+:" + Configuration.HttpServerPortNumber + "/mediabrowser/");
 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         }
 
														 | 
														
														 | 
														
															         }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         /// <summary>
 
														 | 
														
														 | 
														
															         /// <summary>
 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -234,5 +240,10 @@ namespace MediaBrowser.Common.Kernel 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return null;
 
														 | 
														
														 | 
														
															             return null;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         }
 
														 | 
														
														 | 
														
															         }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        public void Dispose()
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            DisposeHttpServer();
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     }
 
														 | 
														
														 | 
														
															     }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 }
 
														 | 
														
														 | 
														
															 }
 
														 |