aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/EnvironmentInfo
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-05-24 15:40:25 -0400
committerGitHub <noreply@github.com>2017-05-24 15:40:25 -0400
commitff19fd971c3dadd716cb49366691b830d41cea26 (patch)
treed12fde3dd5178579e71e2f268602ad642ffaebe7 /Emby.Common.Implementations/EnvironmentInfo
parent57bce7daf3777be0ab83833d140c3bb1b13766a8 (diff)
parent71f7fc4e116f32a20c63ddbb17844a81283a6ba4 (diff)
Merge pull request #2658 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Common.Implementations/EnvironmentInfo')
-rw-r--r--Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs46
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;
}
}