diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-04-29 02:23:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-29 02:23:26 -0400 |
| commit | bdfbc854f7db7200b30401027d31a45add23c93f (patch) | |
| tree | 4651bb0b726c25ae7bbf2cfce1bea132068866b3 /Emby.Common.Implementations | |
| parent | 25b25afbb837adcb0af723f63ad54f9be8fe7de7 (diff) | |
| parent | 6b17dd9db457fc1064b6d2b63389de8da624620a (diff) | |
Merge pull request #2601 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Common.Implementations')
| -rw-r--r-- | Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs | 40 | ||||
| -rw-r--r-- | Emby.Common.Implementations/project.json | 1 |
2 files changed, 9 insertions, 32 deletions
diff --git a/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs index ad6e35700b..a9debe8d20 100644 --- a/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs +++ b/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs @@ -22,30 +22,19 @@ namespace Emby.Common.Implementations.EnvironmentInfo return CustomOperatingSystem.Value; } -#if NET46 - 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; - } -#elif NETSTANDARD1_6 if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - return OperatingSystem.OSX; + return MediaBrowser.Model.System.OperatingSystem.OSX; } if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - return OperatingSystem.Windows; + return MediaBrowser.Model.System.OperatingSystem.Windows; } if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - return OperatingSystem.Linux; + return MediaBrowser.Model.System.OperatingSystem.Linux; } -#endif + return MediaBrowser.Model.System.OperatingSystem.Windows; } } @@ -54,12 +43,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo { get { -#if NET46 - return Environment.OSVersion.Platform.ToString(); -#elif NETSTANDARD1_6 - return System.Runtime.InteropServices.RuntimeInformation.OSDescription; -#endif - return "Operating System"; + return System.Runtime.InteropServices.RuntimeInformation.OSDescription; } } @@ -67,12 +51,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo { get { -#if NET46 - return Environment.OSVersion.Version.ToString() + " " + Environment.OSVersion.ServicePack.ToString(); -#elif NETSTANDARD1_6 - return System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; -#endif - return "1.0"; + return System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; } } @@ -92,10 +71,8 @@ namespace Emby.Common.Implementations.EnvironmentInfo { return CustomArchitecture.Value; } -#if NET46 - return Environment.Is64BitOperatingSystem ? MediaBrowser.Model.System.Architecture.X64 : MediaBrowser.Model.System.Architecture.X86; -#elif NETSTANDARD1_6 - switch(System.Runtime.InteropServices.RuntimeInformation.OSArchitecture) + + switch (System.Runtime.InteropServices.RuntimeInformation.OSArchitecture) { case System.Runtime.InteropServices.Architecture.Arm: return MediaBrowser.Model.System.Architecture.Arm; @@ -106,7 +83,6 @@ namespace Emby.Common.Implementations.EnvironmentInfo case System.Runtime.InteropServices.Architecture.X86: return MediaBrowser.Model.System.Architecture.X86; } -#endif return MediaBrowser.Model.System.Architecture.X64; } } diff --git a/Emby.Common.Implementations/project.json b/Emby.Common.Implementations/project.json index 674101e8a7..dcd4085b94 100644 --- a/Emby.Common.Implementations/project.json +++ b/Emby.Common.Implementations/project.json @@ -23,6 +23,7 @@ "System.Xml.ReaderWriter": "4.0.0" }, "dependencies": { + "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", "SimpleInjector": "3.2.4", "ServiceStack.Text": "4.5.4", "NLog": "4.4.0-betaV15", |
