aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-01-02 00:41:47 +0100
committerVasily <JustAMan@users.noreply.github.com>2019-01-02 02:45:06 +0300
commit6643ac3ea412ea62fc067ae6b24ddfe69fd18482 (patch)
tree9f655432ea820abb491c4524f3524dcfcdb9c4e1 /Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
parenta445233192954dec53f1ed01eec6871039c123ed (diff)
Clean up EnvironmentInfo
Diffstat (limited to 'Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs')
-rw-r--r--Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs32
1 files changed, 5 insertions, 27 deletions
diff --git a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
index 985eb71da..03e10e7ea 100644
--- a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
+++ b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
@@ -8,35 +8,13 @@ namespace Emby.Server.Implementations.EnvironmentInfo
// TODO: Rework @bond
public class EnvironmentInfo : IEnvironmentInfo
{
- private MediaBrowser.Model.System.OperatingSystem? _customOperatingSystem;
-
- public virtual MediaBrowser.Model.System.OperatingSystem OperatingSystem
+ public EnvironmentInfo(MediaBrowser.Model.System.OperatingSystem operatingSystem)
{
- get
- {
- if (_customOperatingSystem.HasValue)
- {
- return _customOperatingSystem.Value;
- }
-
- switch (Environment.OSVersion.Platform)
- {
- case PlatformID.MacOSX:
- return MediaBrowser.Model.System.OperatingSystem.OSX;
- case PlatformID.Win32NT:
- return MediaBrowser.Model.System.OperatingSystem.Windows;
- case PlatformID.Unix:
- return MediaBrowser.Model.System.OperatingSystem.Linux;
- }
-
- return MediaBrowser.Model.System.OperatingSystem.Windows;
- }
- set
- {
- _customOperatingSystem = value;
- }
+ OperatingSystem = operatingSystem;
}
+ public MediaBrowser.Model.System.OperatingSystem OperatingSystem { get; private set; }
+
public string OperatingSystemName
{
get
@@ -69,7 +47,7 @@ namespace Emby.Server.Implementations.EnvironmentInfo
}
}
- public Architecture SystemArchitecture { get; set; }
+ public Architecture SystemArchitecture { get { return RuntimeInformation.OSArchitecture; } }
public string GetEnvironmentVariable(string name)
{