aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-06-23 13:04:18 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-06-23 13:04:18 -0400
commitcffc9417c7a25263a194615096685bd8ef1e37b2 (patch)
tree7b524ef331f06c2ff66abd6c0dfad6dfebac0a28 /MediaBrowser.Server.Startup.Common
parent82e80857472b94ea73798276ef76829a86f5c2e5 (diff)
update startup wizard
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs14
-rw-r--r--MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegLoader.cs18
-rw-r--r--MediaBrowser.Server.Startup.Common/NativeEnvironment.cs10
3 files changed, 17 insertions, 25 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index e7e6a9dc3a..7390fbbbc4 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -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
};
}
diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegLoader.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegLoader.cs
index 2c393ff29b..a4c50d0d8f 100644
--- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegLoader.cs
+++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegLoader.cs
@@ -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)
diff --git a/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs b/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs
index 5b45afe731..b30509982e 100644
--- a/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs
+++ b/MediaBrowser.Server.Startup.Common/NativeEnvironment.cs
@@ -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
- }
}