aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs')
-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 27fc642f1..89aa787b5 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;
}
}