From cc403f2c2fcc0fed14539bd075fb219ad48160a6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 16 Aug 2013 10:18:09 -0400 Subject: [PATCH] added mac address to system info --- MediaBrowser.Model/System/SystemInfo.cs | 6 ++++++ .../ApplicationHost.cs | 20 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index 37aa86047..e605a5daa 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -13,6 +13,12 @@ namespace MediaBrowser.Model.System /// The version. public string Version { get; set; } + /// + /// Gets or sets the mac address. + /// + /// The mac address. + public string MacAddress { get; set; } + /// /// Gets or sets a value indicating whether this instance has pending restart. /// diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 3d640190c..2e3037b71 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -582,10 +582,28 @@ namespace MediaBrowser.ServerApplication InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(), CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(), Id = _systemId, - ProgramDataPath = ApplicationPaths.ProgramDataPath + ProgramDataPath = ApplicationPaths.ProgramDataPath, + MacAddress = GetMacAddress() }; } + /// + /// Gets the mac address. + /// + /// System.String. + private string GetMacAddress() + { + try + { + return NetworkManager.GetMacAddress(); + } + catch (Exception ex) + { + Logger.ErrorException("Error getting mac address", ex); + return null; + } + } + /// /// Shuts down. ///