From b86a03bbdcca3c03b2cd880e607472bc7b3d0850 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Fri, 15 Mar 2013 00:23:07 -0400 Subject: Added an Id property to SystemInfo --- MediaBrowser.ServerApplication/ApplicationHost.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 2ab9f0a44..93396faf9 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -2,6 +2,7 @@ using MediaBrowser.Common; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Constants; +using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Implementations; using MediaBrowser.Common.Implementations.ScheduledTasks; using MediaBrowser.Common.IO; @@ -133,7 +134,7 @@ namespace MediaBrowser.ServerApplication /// protected override string ProductShortcutPath { - get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu),"Media Browser 3", "Media Browser Server.lnk"); } + get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Media Browser 3", "Media Browser Server.lnk"); } } /// @@ -163,7 +164,7 @@ namespace MediaBrowser.ServerApplication await base.RegisterResources().ConfigureAwait(false); RegisterSingleInstance(new HttpResultFactory()); - + RegisterSingleInstance(this); RegisterSingleInstance(ApplicationPaths); @@ -247,14 +248,14 @@ namespace MediaBrowser.ServerApplication base.FindParts(); Parallel.Invoke( - + () => - { - HttpServer.Init(GetExports(false)); + { + HttpServer.Init(GetExports(false)); - ServerManager.AddWebSocketListeners(GetExports(false)); - ServerManager.Start(); - }, + ServerManager.AddWebSocketListeners(GetExports(false)); + ServerManager.Start(); + }, () => LibraryManager.AddParts(GetExports(), GetExports(), GetExports(), GetExports(), GetExports()), @@ -334,6 +335,8 @@ namespace MediaBrowser.ServerApplication yield return GetType().Assembly; } + private readonly Guid _systemId = Environment.MachineName.GetMD5(); + /// /// Gets the system status. /// @@ -349,7 +352,8 @@ namespace MediaBrowser.ServerApplication SupportsNativeWebSocket = ServerManager.SupportsNativeWebSocket, FailedPluginAssemblies = FailedAssemblies.ToArray(), InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(), - CompletedInstallations = InstallationManager.CompletedInstallations.ToArray() + CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(), + Id = _systemId }; } -- cgit v1.2.3