update startup wizard

This commit is contained in:
Luke Pulverenti
2016-06-23 13:04:18 -04:00
parent 82e8085747
commit cffc9417c7
20 changed files with 192 additions and 90 deletions

View File

@@ -647,15 +647,20 @@ namespace MediaBrowser.Server.Startup.Common
/// <returns>Task.</returns>
private async Task RegisterMediaEncoder(IProgress<double> progress)
{
string encoderPath = null;
string probePath = null;
var info = await new FFMpegLoader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager, NativeApp.Environment, NativeApp.GetFfmpegInstallInfo())
.GetFFMpegInfo(NativeApp.Environment, _startupOptions, progress).ConfigureAwait(false);
_hasExternalEncoder = string.Equals(info.Version, "custom", StringComparison.OrdinalIgnoreCase);
encoderPath = info.EncoderPath;
probePath = info.ProbePath;
_hasExternalEncoder = string.Equals(info.Version, "external", StringComparison.OrdinalIgnoreCase);
var mediaEncoder = new MediaEncoder(LogManager.GetLogger("MediaEncoder"),
JsonSerializer,
info.EncoderPath,
info.ProbePath,
encoderPath,
probePath,
_hasExternalEncoder,
ServerConfigurationManager,
FileSystemManager,
@@ -1145,7 +1150,8 @@ namespace MediaBrowser.Server.Startup.Common
ServerName = FriendlyName,
LocalAddress = localAddress,
SupportsLibraryMonitor = SupportsLibraryMonitor,
HasExternalEncoder = _hasExternalEncoder
HasExternalEncoder = _hasExternalEncoder,
SystemArchitecture = NativeApp.Environment.SystemArchitecture
};
}

View File

@@ -53,13 +53,17 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
{
ProbePath = customffProbePath,
EncoderPath = customffMpegPath,
Version = "custom"
Version = "external"
};
}
var downloadInfo = _ffmpegInstallInfo;
var version = downloadInfo.Version;
if (string.Equals(version, "0", StringComparison.OrdinalIgnoreCase))
{
return new FFMpegInfo();
}
if (string.Equals(version, "path", StringComparison.OrdinalIgnoreCase))
{
@@ -175,18 +179,6 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
return null;
}
private async void DownloadFFMpegInBackground(FFMpegInstallInfo downloadinfo, string directory)
{
try
{
await DownloadFFMpeg(downloadinfo, directory, new Progress<double>()).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error downloading ffmpeg", ex);
}
}
private async Task DownloadFFMpeg(FFMpegInstallInfo downloadinfo, string directory, IProgress<double> progress)
{
foreach (var url in downloadinfo.DownloadUrls)

View File

@@ -1,4 +1,5 @@

using MediaBrowser.Model.System;
namespace MediaBrowser.Server.Startup.Common
{
public class NativeEnvironment
@@ -15,11 +16,4 @@ namespace MediaBrowser.Server.Startup.Common
Bsd = 2,
Linux = 3
}
public enum Architecture
{
X86 = 0,
X86_X64 = 1,
Arm = 2
}
}