diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-05-31 15:40:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-31 15:40:34 -0400 |
| commit | 91176d9ccc1dde8155c10411c70e62a9f4b059d5 (patch) | |
| tree | 21365f5a8dd09534a53d9f88d2a7a3116f3f3f98 /Emby.Common.Implementations/EnvironmentInfo | |
| parent | c37c9a75073b1b9caa3af2c3bc62abd837bd630e (diff) | |
| parent | 4e10daf646e0788409f2bc52ef70effa2616e3f3 (diff) | |
Merge pull request #2677 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Common.Implementations/EnvironmentInfo')
| -rw-r--r-- | Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs index 27fc642f14..89aa787b56 100644 --- a/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs +++ b/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs @@ -10,7 +10,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo { public class EnvironmentInfo : IEnvironmentInfo { - public MediaBrowser.Model.System.Architecture? CustomArchitecture { get; set; } + public Architecture? CustomArchitecture { get; set; } public MediaBrowser.Model.System.OperatingSystem? CustomOperatingSystem { get; set; } public virtual MediaBrowser.Model.System.OperatingSystem OperatingSystem @@ -22,7 +22,6 @@ namespace Emby.Common.Implementations.EnvironmentInfo return CustomOperatingSystem.Value; } -#if NET46 switch (Environment.OSVersion.Platform) { case PlatformID.MacOSX: @@ -32,20 +31,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo case PlatformID.Unix: return MediaBrowser.Model.System.OperatingSystem.Linux; } -#elif NETSTANDARD1_6 - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - return OperatingSystem.OSX; - } - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - return OperatingSystem.Windows; - } - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - return OperatingSystem.Linux; - } -#endif + return MediaBrowser.Model.System.OperatingSystem.Windows; } } @@ -54,12 +40,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"; } } @@ -67,12 +48,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"; } } @@ -84,7 +60,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo } } - public MediaBrowser.Model.System.Architecture SystemArchitecture + public Architecture SystemArchitecture { get { @@ -92,22 +68,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) - { - case System.Runtime.InteropServices.Architecture.Arm: - return MediaBrowser.Model.System.Architecture.Arm; - case System.Runtime.InteropServices.Architecture.Arm64: - return MediaBrowser.Model.System.Architecture.Arm64; - case System.Runtime.InteropServices.Architecture.X64: - return MediaBrowser.Model.System.Architecture.X64; - case System.Runtime.InteropServices.Architecture.X86: - return MediaBrowser.Model.System.Architecture.X86; - } -#endif - return MediaBrowser.Model.System.Architecture.X64; } } |
