2019-01-13 20:54:44 +01:00
|
|
|
using System;
|
2019-01-01 16:27:11 +01:00
|
|
|
using System.Runtime.InteropServices;
|
2019-01-13 20:20:41 +01:00
|
|
|
using MediaBrowser.Model.System;
|
2016-11-04 20:51:59 +01:00
|
|
|
|
2017-08-16 08:43:41 +02:00
|
|
|
namespace Emby.Server.Implementations.EnvironmentInfo
|
2016-11-04 20:51:59 +01:00
|
|
|
{
|
|
|
|
public class EnvironmentInfo : IEnvironmentInfo
|
|
|
|
{
|
2019-01-02 00:41:47 +01:00
|
|
|
public EnvironmentInfo(MediaBrowser.Model.System.OperatingSystem operatingSystem)
|
2016-11-04 20:51:59 +01:00
|
|
|
{
|
2019-01-02 00:41:47 +01:00
|
|
|
OperatingSystem = operatingSystem;
|
2016-11-04 20:51:59 +01:00
|
|
|
}
|
|
|
|
|
2019-01-02 00:41:47 +01:00
|
|
|
public MediaBrowser.Model.System.OperatingSystem OperatingSystem { get; private set; }
|
|
|
|
|
2016-11-04 20:51:59 +01:00
|
|
|
public string OperatingSystemName
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2019-01-02 00:21:06 +01:00
|
|
|
switch (OperatingSystem)
|
|
|
|
{
|
2019-01-01 18:41:02 +01:00
|
|
|
case MediaBrowser.Model.System.OperatingSystem.Android: return "Android";
|
|
|
|
case MediaBrowser.Model.System.OperatingSystem.BSD: return "BSD";
|
|
|
|
case MediaBrowser.Model.System.OperatingSystem.Linux: return "Linux";
|
|
|
|
case MediaBrowser.Model.System.OperatingSystem.OSX: return "macOS";
|
|
|
|
case MediaBrowser.Model.System.OperatingSystem.Windows: return "Windows";
|
|
|
|
default: throw new Exception($"Unknown OS {OperatingSystem}");
|
|
|
|
}
|
2016-11-04 20:51:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-06 21:50:43 +01:00
|
|
|
public string OperatingSystemVersion => Environment.OSVersion.Version.ToString() + " " + Environment.OSVersion.ServicePack.ToString();
|
2016-11-11 09:13:11 +01:00
|
|
|
|
2019-01-06 21:50:43 +01:00
|
|
|
public Architecture SystemArchitecture => RuntimeInformation.OSArchitecture;
|
2016-11-04 20:51:59 +01:00
|
|
|
}
|
2018-12-13 14:18:25 +01:00
|
|
|
}
|