aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/EnvironmentInfo
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-11 03:13:11 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-11 03:13:11 -0500
commit918b9ca86d1bdb9758430e9164f5fba72de1d9a7 (patch)
tree1f9ec909d18593a8f69a6dbbf7af580ad25005a5 /Emby.Common.Implementations/EnvironmentInfo
parentf8dd02bb66d2f243515d295b4d256a4c74f433ca (diff)
update core projects
Diffstat (limited to 'Emby.Common.Implementations/EnvironmentInfo')
-rw-r--r--Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs
index 8cea617ea..6a1b3ef74 100644
--- a/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs
+++ b/Emby.Common.Implementations/EnvironmentInfo/EnvironmentInfo.cs
@@ -9,6 +9,8 @@ namespace Emby.Common.Implementations.EnvironmentInfo
{
public class EnvironmentInfo : IEnvironmentInfo
{
+ public MediaBrowser.Model.System.Architecture? CustomArchitecture { get; set; }
+
public MediaBrowser.Model.System.OperatingSystem OperatingSystem
{
get
@@ -66,5 +68,32 @@ namespace Emby.Common.Implementations.EnvironmentInfo
return "1.0";
}
}
+
+ public MediaBrowser.Model.System.Architecture SystemArchitecture
+ {
+ get
+ {
+ if (CustomArchitecture.HasValue)
+ {
+ 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;
+ }
+ }
}
}