From 9e19101f25efe69a297ad8fab8823992b9027333 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 23 Aug 2013 19:22:45 -0400 Subject: [PATCH] add download error handling --- .../MediaEncoder/MediaEncoder.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index 6c2e9606a1..2ce49aabb9 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -198,14 +198,21 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// The assembly. /// The zip file resource path. /// The target path. - private void ExtractTools(Assembly assembly, string zipFileResourcePath, string targetPath) + private async void ExtractTools(Assembly assembly, string zipFileResourcePath, string targetPath) { using (var resourceStream = assembly.GetManifestResourceStream(zipFileResourcePath)) { _zipClient.ExtractAll(resourceStream, targetPath, false); } - ExtractFonts(targetPath); + try + { + await DownloadFonts(targetPath).ConfigureAwait(false); + } + catch (Exception ex) + { + _logger.ErrorException("Error getting ffmpeg font files", ex); + } } private const string FontUrl = "https://www.dropbox.com/s/9nb76tybcsw5xrk/ARIALUNI.zip?dl=1"; @@ -214,7 +221,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// Extracts the fonts. /// /// The target path. - private async void ExtractFonts(string targetPath) + private async Task DownloadFonts(string targetPath) { var fontsDirectory = Path.Combine(targetPath, "fonts");