mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 05:34:16 -04:00
Clean up EnvironmentInfo
This commit is contained in:
parent
a445233192
commit
6643ac3ea4
@ -8,35 +8,13 @@ namespace Emby.Server.Implementations.EnvironmentInfo
|
|||||||
// TODO: Rework @bond
|
// TODO: Rework @bond
|
||||||
public class EnvironmentInfo : IEnvironmentInfo
|
public class EnvironmentInfo : IEnvironmentInfo
|
||||||
{
|
{
|
||||||
private MediaBrowser.Model.System.OperatingSystem? _customOperatingSystem;
|
public EnvironmentInfo(MediaBrowser.Model.System.OperatingSystem operatingSystem)
|
||||||
|
|
||||||
public virtual MediaBrowser.Model.System.OperatingSystem OperatingSystem
|
|
||||||
{
|
{
|
||||||
get
|
OperatingSystem = operatingSystem;
|
||||||
{
|
|
||||||
if (_customOperatingSystem.HasValue)
|
|
||||||
{
|
|
||||||
return _customOperatingSystem.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (Environment.OSVersion.Platform)
|
|
||||||
{
|
|
||||||
case PlatformID.MacOSX:
|
|
||||||
return MediaBrowser.Model.System.OperatingSystem.OSX;
|
|
||||||
case PlatformID.Win32NT:
|
|
||||||
return MediaBrowser.Model.System.OperatingSystem.Windows;
|
|
||||||
case PlatformID.Unix:
|
|
||||||
return MediaBrowser.Model.System.OperatingSystem.Linux;
|
|
||||||
}
|
|
||||||
|
|
||||||
return MediaBrowser.Model.System.OperatingSystem.Windows;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_customOperatingSystem = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MediaBrowser.Model.System.OperatingSystem OperatingSystem { get; private set; }
|
||||||
|
|
||||||
public string OperatingSystemName
|
public string OperatingSystemName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -69,7 +47,7 @@ namespace Emby.Server.Implementations.EnvironmentInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Architecture SystemArchitecture { get; set; }
|
public Architecture SystemArchitecture { get { return RuntimeInformation.OSArchitecture; } }
|
||||||
|
|
||||||
public string GetEnvironmentVariable(string name)
|
public string GetEnvironmentVariable(string name)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ namespace Jellyfin.Server
|
|||||||
|
|
||||||
_logger.LogInformation("Jellyfin version: {Version}", version);
|
_logger.LogInformation("Jellyfin version: {Version}", version);
|
||||||
|
|
||||||
EnvironmentInfo environmentInfo = getEnvironmentInfo();
|
EnvironmentInfo environmentInfo = new EnvironmentInfo(getOperatingSystem());
|
||||||
ApplicationHost.LogEnvironmentInfo(_logger, appPaths, environmentInfo);
|
ApplicationHost.LogEnvironmentInfo(_logger, appPaths, environmentInfo);
|
||||||
|
|
||||||
SQLitePCL.Batteries_V2.Init();
|
SQLitePCL.Batteries_V2.Init();
|
||||||
@ -220,13 +220,6 @@ namespace Jellyfin.Server
|
|||||||
return new NullImageEncoder();
|
return new NullImageEncoder();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static EnvironmentInfo getEnvironmentInfo()
|
|
||||||
=> new EnvironmentInfo()
|
|
||||||
{
|
|
||||||
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
|
||||||
OperatingSystem = getOperatingSystem()
|
|
||||||
};
|
|
||||||
|
|
||||||
private static MediaBrowser.Model.System.OperatingSystem getOperatingSystem() {
|
private static MediaBrowser.Model.System.OperatingSystem getOperatingSystem() {
|
||||||
switch (Environment.OSVersion.Platform)
|
switch (Environment.OSVersion.Platform)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user