mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-29 05:16:30 +01:00
consolidate os display name
This commit is contained in:
@@ -266,6 +266,11 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
}
|
||||
}
|
||||
|
||||
public override string OperatingSystemDisplayName
|
||||
{
|
||||
get { return NativeApp.Environment.OperatingSystemVersionString; }
|
||||
}
|
||||
|
||||
public override bool IsRunningAsService
|
||||
{
|
||||
get { return NativeApp.IsRunningAsService; }
|
||||
@@ -531,7 +536,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
/// <returns>Task.</returns>
|
||||
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);
|
||||
|
||||
new FFmpegValidator(Logger, ApplicationPaths).Validate(info);
|
||||
@@ -909,7 +914,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
CachePath = ApplicationPaths.CachePath,
|
||||
MacAddress = GetMacAddress(),
|
||||
HttpServerPortNumber = HttpServerPort,
|
||||
OperatingSystem = Environment.OSVersion.ToString(),
|
||||
OperatingSystem = OperatingSystemDisplayName,
|
||||
CanSelfRestart = CanSelfRestart,
|
||||
CanSelfUpdate = CanSelfUpdate,
|
||||
WanAddress = ConnectManager.WanApiAddress,
|
||||
|
||||
@@ -22,19 +22,21 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
|
||||
private readonly ILogger _logger;
|
||||
private readonly IZipClient _zipClient;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly NativeEnvironment _environment;
|
||||
|
||||
private readonly string[] _fontUrls =
|
||||
{
|
||||
"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;
|
||||
_appPaths = appPaths;
|
||||
_httpClient = httpClient;
|
||||
_zipClient = zipClient;
|
||||
_fileSystem = fileSystem;
|
||||
_environment = environment;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
{
|
||||
public OperatingSystem OperatingSystem { get; set; }
|
||||
public Architecture SystemArchitecture { get; set; }
|
||||
public string OperatingSystemVersionString { get; set; }
|
||||
}
|
||||
|
||||
public enum OperatingSystem
|
||||
|
||||
Reference in New Issue
Block a user