Browse Source

Added an Id property to SystemInfo

LukePulverenti 12 years ago
parent
commit
b86a03bbdc

+ 9 - 0
MediaBrowser.Model/System/SystemInfo.cs

@@ -1,5 +1,6 @@
 using MediaBrowser.Model.Updates;
 using MediaBrowser.Model.Updates;
 using ProtoBuf;
 using ProtoBuf;
+using System;
 
 
 namespace MediaBrowser.Model.System
 namespace MediaBrowser.Model.System
 {
 {
@@ -62,6 +63,14 @@ namespace MediaBrowser.Model.System
         /// Gets or sets plugin assemblies that failed to load.
         /// Gets or sets plugin assemblies that failed to load.
         /// </summary>
         /// </summary>
         /// <value>The failed assembly loads.</value>
         /// <value>The failed assembly loads.</value>
+        [ProtoMember(8)]
         public string[] FailedPluginAssemblies { get; set; }
         public string[] FailedPluginAssemblies { get; set; }
+
+        /// <summary>
+        /// Gets or sets the id.
+        /// </summary>
+        /// <value>The id.</value>
+        [ProtoMember(9)]
+        public Guid Id { get; set; }
     }
     }
 }
 }

+ 13 - 9
MediaBrowser.ServerApplication/ApplicationHost.cs

@@ -2,6 +2,7 @@
 using MediaBrowser.Common;
 using MediaBrowser.Common;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Common.Constants;
 using MediaBrowser.Common.Constants;
+using MediaBrowser.Common.Extensions;
 using MediaBrowser.Common.Implementations;
 using MediaBrowser.Common.Implementations;
 using MediaBrowser.Common.Implementations.ScheduledTasks;
 using MediaBrowser.Common.Implementations.ScheduledTasks;
 using MediaBrowser.Common.IO;
 using MediaBrowser.Common.IO;
@@ -133,7 +134,7 @@ namespace MediaBrowser.ServerApplication
         /// </summary>
         /// </summary>
         protected override string ProductShortcutPath
         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"); }
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -163,7 +164,7 @@ namespace MediaBrowser.ServerApplication
             await base.RegisterResources().ConfigureAwait(false);
             await base.RegisterResources().ConfigureAwait(false);
 
 
             RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory());
             RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory());
-            
+
             RegisterSingleInstance<IServerApplicationHost>(this);
             RegisterSingleInstance<IServerApplicationHost>(this);
             RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths);
             RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths);
 
 
@@ -247,14 +248,14 @@ namespace MediaBrowser.ServerApplication
             base.FindParts();
             base.FindParts();
 
 
             Parallel.Invoke(
             Parallel.Invoke(
-                
+
                 () =>
                 () =>
-                    {
-                        HttpServer.Init(GetExports<IRestfulService>(false));
+                {
+                    HttpServer.Init(GetExports<IRestfulService>(false));
 
 
-                        ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false));
-                        ServerManager.Start();
-                    },
+                    ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false));
+                    ServerManager.Start();
+                },
 
 
                 () => LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(), GetExports<IVirtualFolderCreator>(), GetExports<IItemResolver>(), GetExports<IIntroProvider>(), GetExports<IBaseItemComparer>()),
                 () => LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(), GetExports<IVirtualFolderCreator>(), GetExports<IItemResolver>(), GetExports<IIntroProvider>(), GetExports<IBaseItemComparer>()),
 
 
@@ -334,6 +335,8 @@ namespace MediaBrowser.ServerApplication
             yield return GetType().Assembly;
             yield return GetType().Assembly;
         }
         }
 
 
+        private readonly Guid _systemId = Environment.MachineName.GetMD5();
+
         /// <summary>
         /// <summary>
         /// Gets the system status.
         /// Gets the system status.
         /// </summary>
         /// </summary>
@@ -349,7 +352,8 @@ namespace MediaBrowser.ServerApplication
                 SupportsNativeWebSocket = ServerManager.SupportsNativeWebSocket,
                 SupportsNativeWebSocket = ServerManager.SupportsNativeWebSocket,
                 FailedPluginAssemblies = FailedAssemblies.ToArray(),
                 FailedPluginAssemblies = FailedAssemblies.ToArray(),
                 InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(),
                 InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(),
-                CompletedInstallations = InstallationManager.CompletedInstallations.ToArray()
+                CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),
+                Id = _systemId
             };
             };
         }
         }
 
 

+ 1 - 1
MediaBrowser.WebDashboard/Html/about.html

@@ -26,7 +26,7 @@
                     <br/>
                     <br/>
                     <br/>
                     <br/>
                     <p>
                     <p>
-                        Utilizing <a href="http://www.pismotechnic.com/pfm/" />Pismo File Mount</a> through a donated license.
+                        Utilizing <a href="http://www.pismotechnic.com/pfm/" target="_blank">Pismo File Mount</a> through a donated license.
                     </p>                    
                     </p>                    
                 </div>
                 </div>
             </div>
             </div>

+ 5 - 5
MediaBrowser.WebDashboard/Html/scripts/aboutPage.js

@@ -6,17 +6,17 @@
 
 
 
 
     pollForInfo: function () {
     pollForInfo: function () {
-        $.getJSON("dashboardInfo").done(AboutPage.renderInfo);
+        ApiClient.getSystemInfo().done(AboutPage.renderInfo);
     },
     },
 
 
-    renderInfo: function (dashboardInfo) {
-        AboutPage.renderSystemInfo(dashboardInfo);
+    renderInfo: function (info) {
+        AboutPage.renderSystemInfo(info);
     },
     },
 
 
 
 
-    renderSystemInfo: function (dashboardInfo) {
+    renderSystemInfo: function (info) {
         var page = $.mobile.activePage;
         var page = $.mobile.activePage;
-        $('#appVersionNumber', page).html(dashboardInfo.SystemInfo.Version);
+        $('#appVersionNumber', page).html(info.Version);
     },
     },
 
 
 };
 };