mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
consolidate os display name
This commit is contained in:
parent
1923de72bf
commit
2df4273ee0
@ -193,6 +193,11 @@ namespace MediaBrowser.Common.Implementations
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual string OperatingSystemDisplayName
|
||||||
|
{
|
||||||
|
get { return Environment.OSVersion.VersionString; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -208,7 +208,7 @@ namespace MediaBrowser.Common.Implementations.Security
|
|||||||
{ "systemid", _appHost.SystemId },
|
{ "systemid", _appHost.SystemId },
|
||||||
{ "mb2equiv", mb2Equivalent },
|
{ "mb2equiv", mb2Equivalent },
|
||||||
{ "ver", version },
|
{ "ver", version },
|
||||||
{ "platform", Environment.OSVersion.VersionString },
|
{ "platform", _appHost.OperatingSystemDisplayName },
|
||||||
{ "isservice", _appHost.IsRunningAsService.ToString().ToLower() }
|
{ "isservice", _appHost.IsRunningAsService.ToString().ToLower() }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,6 +13,12 @@ namespace MediaBrowser.Common
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IApplicationHost
|
public interface IApplicationHost
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the display name of the operating system.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The display name of the operating system.</value>
|
||||||
|
string OperatingSystemDisplayName { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name.
|
/// Gets the name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -33,7 +33,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
|||||||
{ "serverid", _applicationHost.SystemId },
|
{ "serverid", _applicationHost.SystemId },
|
||||||
{ "deviceid", _applicationHost.SystemId },
|
{ "deviceid", _applicationHost.SystemId },
|
||||||
{ "ver", _applicationHost.ApplicationVersion.ToString() },
|
{ "ver", _applicationHost.ApplicationVersion.ToString() },
|
||||||
{ "platform", Environment.OSVersion.VersionString },
|
{ "platform", _applicationHost.OperatingSystemDisplayName },
|
||||||
{ "isservice", _applicationHost.IsRunningAsService.ToString().ToLower()}
|
{ "isservice", _applicationHost.IsRunningAsService.ToString().ToLower()}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@
|
|||||||
<Compile Include="..\SharedVersion.cs">
|
<Compile Include="..\SharedVersion.cs">
|
||||||
<Link>Properties\SharedVersion.cs</Link>
|
<Link>Properties\SharedVersion.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Native\BaseMonoApp.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Native\NativeApp.cs" />
|
<Compile Include="Native\NativeApp.cs" />
|
||||||
|
193
MediaBrowser.Server.Mono/Native/BaseMonoApp.cs
Normal file
193
MediaBrowser.Server.Mono/Native/BaseMonoApp.cs
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
using MediaBrowser.Common.Net;
|
||||||
|
using MediaBrowser.IsoMounter;
|
||||||
|
using MediaBrowser.Model.Logging;
|
||||||
|
using MediaBrowser.Server.Mono.Networking;
|
||||||
|
using MediaBrowser.Server.Startup.Common;
|
||||||
|
using Mono.Unix.Native;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Server.Mono.Native
|
||||||
|
{
|
||||||
|
public abstract class BaseMonoApp : INativeApp
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Shutdowns this instance.
|
||||||
|
/// </summary>
|
||||||
|
public abstract void Shutdown();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Restarts this instance.
|
||||||
|
/// </summary>
|
||||||
|
public void Restart()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether this instance [can self restart].
|
||||||
|
/// </summary>
|
||||||
|
/// <returns><c>true</c> if this instance [can self restart]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool CanSelfRestart
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether this instance can self update.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
||||||
|
public bool CanSelfUpdate
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SupportsAutoRunAtStartup
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PreventSystemStandby()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Assembly> GetAssembliesWithParts()
|
||||||
|
{
|
||||||
|
var list = new List<Assembly>();
|
||||||
|
|
||||||
|
if (Environment.OperatingSystem == Startup.Common.OperatingSystem.Linux)
|
||||||
|
{
|
||||||
|
list.AddRange(GetLinuxAssemblies());
|
||||||
|
}
|
||||||
|
|
||||||
|
list.Add(GetType().Assembly);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<Assembly> GetLinuxAssemblies()
|
||||||
|
{
|
||||||
|
var list = new List<Assembly>();
|
||||||
|
|
||||||
|
list.Add(typeof(LinuxIsoManager).Assembly);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private NativeEnvironment _nativeEnvironment;
|
||||||
|
public NativeEnvironment Environment
|
||||||
|
{
|
||||||
|
get { return _nativeEnvironment ?? (_nativeEnvironment = GetEnvironmentInfo()); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SupportsRunningAsService
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsRunningAsService
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ConfigureAutoRun(bool autorun)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public INetworkManager CreateNetworkManager(ILogger logger)
|
||||||
|
{
|
||||||
|
return new NetworkManager(logger);
|
||||||
|
}
|
||||||
|
|
||||||
|
private NativeEnvironment GetEnvironmentInfo()
|
||||||
|
{
|
||||||
|
var info = new NativeEnvironment
|
||||||
|
{
|
||||||
|
OperatingSystem = Startup.Common.OperatingSystem.Linux
|
||||||
|
};
|
||||||
|
|
||||||
|
var uname = GetUnixName();
|
||||||
|
|
||||||
|
var sysName = uname.sysname ?? string.Empty;
|
||||||
|
|
||||||
|
if (string.Equals(sysName, "Darwin", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
info.OperatingSystem = Startup.Common.OperatingSystem.Osx;
|
||||||
|
}
|
||||||
|
else if (string.Equals(sysName, "Linux", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
info.OperatingSystem = Startup.Common.OperatingSystem.Linux;
|
||||||
|
}
|
||||||
|
else if (string.Equals(sysName, "BSD", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
// TODO: How to detect BSD?
|
||||||
|
info.OperatingSystem = Startup.Common.OperatingSystem.Bsd;
|
||||||
|
}
|
||||||
|
|
||||||
|
var archX86 = new Regex("(i|I)[3-6]86");
|
||||||
|
|
||||||
|
if (archX86.IsMatch(uname.machine))
|
||||||
|
{
|
||||||
|
info.SystemArchitecture = Architecture.X86;
|
||||||
|
}
|
||||||
|
else if (string.Equals(uname.machine, "x86_64", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
info.SystemArchitecture = Architecture.X86_X64;
|
||||||
|
}
|
||||||
|
else if (uname.machine.StartsWith("arm", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
info.SystemArchitecture = Architecture.Arm;
|
||||||
|
}
|
||||||
|
|
||||||
|
info.OperatingSystemVersionString = string.IsNullOrWhiteSpace(sysName) ?
|
||||||
|
System.Environment.OSVersion.VersionString :
|
||||||
|
sysName;
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
private NativeApp.Uname _unixName;
|
||||||
|
private NativeApp.Uname GetUnixName()
|
||||||
|
{
|
||||||
|
if (_unixName == null)
|
||||||
|
{
|
||||||
|
var uname = new NativeApp.Uname();
|
||||||
|
Utsname utsname;
|
||||||
|
var callResult = Syscall.uname(out utsname);
|
||||||
|
if (callResult == 0)
|
||||||
|
{
|
||||||
|
uname.sysname = utsname.sysname;
|
||||||
|
uname.machine = utsname.machine;
|
||||||
|
}
|
||||||
|
|
||||||
|
_unixName = uname;
|
||||||
|
}
|
||||||
|
return _unixName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Uname
|
||||||
|
{
|
||||||
|
public string sysname = string.Empty;
|
||||||
|
public string machine = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,189 +1,17 @@
|
|||||||
using MediaBrowser.Common.Net;
|
|
||||||
using MediaBrowser.IsoMounter;
|
|
||||||
using MediaBrowser.Model.Logging;
|
|
||||||
using MediaBrowser.Server.Mono.Networking;
|
|
||||||
using MediaBrowser.Server.Startup.Common;
|
|
||||||
using Mono.Unix.Native;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Mono.Native
|
namespace MediaBrowser.Server.Mono.Native
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class NativeApp
|
/// Class NativeApp
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class NativeApp : INativeApp
|
public class NativeApp : BaseMonoApp
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shutdowns this instance.
|
/// Shutdowns this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Shutdown()
|
public override void Shutdown()
|
||||||
{
|
{
|
||||||
MainClass.Shutdown();
|
MainClass.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Restarts this instance.
|
|
||||||
/// </summary>
|
|
||||||
public void Restart()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Determines whether this instance [can self restart].
|
|
||||||
/// </summary>
|
|
||||||
/// <returns><c>true</c> if this instance [can self restart]; otherwise, <c>false</c>.</returns>
|
|
||||||
public bool CanSelfRestart
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance can self update.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
|
||||||
public bool CanSelfUpdate
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SupportsAutoRunAtStartup
|
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PreventSystemStandby()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Assembly> GetAssembliesWithParts()
|
|
||||||
{
|
|
||||||
var list = new List<Assembly>();
|
|
||||||
|
|
||||||
if (Environment.OperatingSystem == Startup.Common.OperatingSystem.Linux)
|
|
||||||
{
|
|
||||||
list.AddRange(GetLinuxAssemblies());
|
|
||||||
}
|
|
||||||
|
|
||||||
list.Add(GetType().Assembly);
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Assembly> GetLinuxAssemblies()
|
|
||||||
{
|
|
||||||
var list = new List<Assembly>();
|
|
||||||
|
|
||||||
list.Add(typeof(LinuxIsoManager).Assembly);
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private NativeEnvironment _nativeEnvironment;
|
|
||||||
public NativeEnvironment Environment
|
|
||||||
{
|
|
||||||
get { return _nativeEnvironment ?? (_nativeEnvironment = GetEnvironmentInfo()); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SupportsRunningAsService
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsRunningAsService
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ConfigureAutoRun(bool autorun)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public INetworkManager CreateNetworkManager(ILogger logger)
|
|
||||||
{
|
|
||||||
return new NetworkManager(logger);
|
|
||||||
}
|
|
||||||
|
|
||||||
private NativeEnvironment GetEnvironmentInfo()
|
|
||||||
{
|
|
||||||
var info = new NativeEnvironment
|
|
||||||
{
|
|
||||||
OperatingSystem = Startup.Common.OperatingSystem.Linux
|
|
||||||
};
|
|
||||||
|
|
||||||
var uname = GetUnixName();
|
|
||||||
|
|
||||||
var sysName = uname.sysname ?? string.Empty;
|
|
||||||
|
|
||||||
if (string.Equals(sysName, "Darwin", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
info.OperatingSystem = Startup.Common.OperatingSystem.Osx;
|
|
||||||
}
|
|
||||||
else if (string.Equals(sysName, "Linux", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
info.OperatingSystem = Startup.Common.OperatingSystem.Linux;
|
|
||||||
}
|
|
||||||
else if (string.Equals(sysName, "BSD", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
// TODO: How to detect BSD?
|
|
||||||
info.OperatingSystem = Startup.Common.OperatingSystem.Bsd;
|
|
||||||
}
|
|
||||||
|
|
||||||
var archX86 = new Regex("(i|I)[3-6]86");
|
|
||||||
|
|
||||||
if (archX86.IsMatch(uname.machine))
|
|
||||||
{
|
|
||||||
info.SystemArchitecture = Architecture.X86;
|
|
||||||
}
|
|
||||||
else if (string.Equals(uname.machine, "x86_64", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
info.SystemArchitecture = Architecture.X86_X64;
|
|
||||||
}
|
|
||||||
else if (uname.machine.StartsWith("arm", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
info.SystemArchitecture = Architecture.Arm;
|
|
||||||
}
|
|
||||||
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Uname GetUnixName()
|
|
||||||
{
|
|
||||||
var uname = new Uname();
|
|
||||||
Utsname utsname;
|
|
||||||
var callResult = Syscall.uname(out utsname);
|
|
||||||
if (callResult == 0)
|
|
||||||
{
|
|
||||||
uname.sysname = utsname.sysname;
|
|
||||||
uname.machine = utsname.machine;
|
|
||||||
}
|
|
||||||
return uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Uname
|
|
||||||
{
|
|
||||||
public string sysname = string.Empty;
|
|
||||||
public string machine = string.Empty;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,6 +266,11 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string OperatingSystemDisplayName
|
||||||
|
{
|
||||||
|
get { return NativeApp.Environment.OperatingSystemVersionString; }
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsRunningAsService
|
public override bool IsRunningAsService
|
||||||
{
|
{
|
||||||
get { return NativeApp.IsRunningAsService; }
|
get { return NativeApp.IsRunningAsService; }
|
||||||
@ -531,7 +536,7 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
private async Task RegisterMediaEncoder(IProgress<double> progress)
|
private async Task RegisterMediaEncoder(IProgress<double> progress)
|
||||||
{
|
{
|
||||||
var info = await new FFMpegDownloader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager)
|
var info = await new FFMpegDownloader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager, NativeApp.Environment)
|
||||||
.GetFFMpegInfo(NativeApp.Environment, _startupOptions, progress).ConfigureAwait(false);
|
.GetFFMpegInfo(NativeApp.Environment, _startupOptions, progress).ConfigureAwait(false);
|
||||||
|
|
||||||
new FFmpegValidator(Logger, ApplicationPaths).Validate(info);
|
new FFmpegValidator(Logger, ApplicationPaths).Validate(info);
|
||||||
@ -909,7 +914,7 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
CachePath = ApplicationPaths.CachePath,
|
CachePath = ApplicationPaths.CachePath,
|
||||||
MacAddress = GetMacAddress(),
|
MacAddress = GetMacAddress(),
|
||||||
HttpServerPortNumber = HttpServerPort,
|
HttpServerPortNumber = HttpServerPort,
|
||||||
OperatingSystem = Environment.OSVersion.ToString(),
|
OperatingSystem = OperatingSystemDisplayName,
|
||||||
CanSelfRestart = CanSelfRestart,
|
CanSelfRestart = CanSelfRestart,
|
||||||
CanSelfUpdate = CanSelfUpdate,
|
CanSelfUpdate = CanSelfUpdate,
|
||||||
WanAddress = ConnectManager.WanApiAddress,
|
WanAddress = ConnectManager.WanApiAddress,
|
||||||
|
@ -22,19 +22,21 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
|
|||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IZipClient _zipClient;
|
private readonly IZipClient _zipClient;
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
|
private readonly NativeEnvironment _environment;
|
||||||
|
|
||||||
private readonly string[] _fontUrls =
|
private readonly string[] _fontUrls =
|
||||||
{
|
{
|
||||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/ARIALUNI.7z"
|
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/ARIALUNI.7z"
|
||||||
};
|
};
|
||||||
|
|
||||||
public FFMpegDownloader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient, IFileSystem fileSystem)
|
public FFMpegDownloader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient, IFileSystem fileSystem, NativeEnvironment environment)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_appPaths = appPaths;
|
_appPaths = appPaths;
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
_zipClient = zipClient;
|
_zipClient = zipClient;
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
|
_environment = environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<FFMpegInfo> GetFFMpegInfo(NativeEnvironment environment, StartupOptions options, IProgress<double> progress)
|
public async Task<FFMpegInfo> GetFFMpegInfo(NativeEnvironment environment, StartupOptions options, IProgress<double> progress)
|
||||||
@ -240,7 +242,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
|
|||||||
private void SetFilePermissions(string targetFolder, string file)
|
private void SetFilePermissions(string targetFolder, string file)
|
||||||
{
|
{
|
||||||
// Linux: File permission to 666, and user's execute bit
|
// Linux: File permission to 666, and user's execute bit
|
||||||
if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
|
if (_environment.OperatingSystem == OperatingSystem.Bsd || _environment.OperatingSystem == OperatingSystem.Linux || _environment.OperatingSystem == OperatingSystem.Osx)
|
||||||
{
|
{
|
||||||
Syscall.chmod(Path.Combine(targetFolder, Path.GetFileName(file)), FilePermissions.DEFFILEMODE | FilePermissions.S_IXUSR);
|
Syscall.chmod(Path.Combine(targetFolder, Path.GetFileName(file)), FilePermissions.DEFFILEMODE | FilePermissions.S_IXUSR);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Common.Net;
|
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -5,6 +5,7 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
{
|
{
|
||||||
public OperatingSystem OperatingSystem { get; set; }
|
public OperatingSystem OperatingSystem { get; set; }
|
||||||
public Architecture SystemArchitecture { get; set; }
|
public Architecture SystemArchitecture { get; set; }
|
||||||
|
public string OperatingSystemVersionString { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum OperatingSystem
|
public enum OperatingSystem
|
||||||
|
@ -49,7 +49,7 @@ namespace MediaBrowser.ServerApplication
|
|||||||
|
|
||||||
var logger = _logger = logManager.GetLogger("Main");
|
var logger = _logger = logManager.GetLogger("Main");
|
||||||
|
|
||||||
BeginLog(logger, appPaths);
|
ApplicationHost.LogEnvironmentInfo(logger, appPaths, true);
|
||||||
|
|
||||||
// Install directly
|
// Install directly
|
||||||
if (options.ContainsOption("-installservice"))
|
if (options.ContainsOption("-installservice"))
|
||||||
@ -188,16 +188,6 @@ namespace MediaBrowser.ServerApplication
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Begins the log.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="logger">The logger.</param>
|
|
||||||
/// <param name="appPaths">The app paths.</param>
|
|
||||||
private static void BeginLog(ILogger logger, IApplicationPaths appPaths)
|
|
||||||
{
|
|
||||||
ApplicationHost.LogEnvironmentInfo(logger, appPaths, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly TaskCompletionSource<bool> ApplicationTaskCompletionSource = new TaskCompletionSource<bool>();
|
private static readonly TaskCompletionSource<bool> ApplicationTaskCompletionSource = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -33,7 +33,8 @@ namespace MediaBrowser.ServerApplication.Native
|
|||||||
return new NativeEnvironment
|
return new NativeEnvironment
|
||||||
{
|
{
|
||||||
OperatingSystem = OperatingSystem.Windows,
|
OperatingSystem = OperatingSystem.Windows,
|
||||||
SystemArchitecture = System.Environment.Is64BitOperatingSystem ? Architecture.X86_X64 : Architecture.X86
|
SystemArchitecture = System.Environment.Is64BitOperatingSystem ? Architecture.X86_X64 : Architecture.X86,
|
||||||
|
OperatingSystemVersionString = System.Environment.OSVersion.VersionString
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user