update mac project

This commit is contained in:
Luke Pulverenti 2017-05-13 00:26:39 -04:00
parent 05c678249b
commit 55e8a61218

View File

@ -32,7 +32,10 @@ using Mono.Unix.Native;
using MediaBrowser.Model.System;
using MediaBrowser.Model.IO;
using Emby.Server.Core.Logging;
using Emby.Drawing.Net;
using Emby.Drawing;
using Emby.Drawing.Skia;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.Drawing;
namespace MediaBrowser.Server.Mac
{
@ -112,7 +115,7 @@ namespace MediaBrowser.Server.Mac
_fileSystem = fileSystem;
var imageEncoder = new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI"));
var imageEncoder = GetImageEncoder(appPaths, fileSystem, logManager);
AppHost = new MacAppHost(appPaths,
logManager,
@ -138,6 +141,18 @@ namespace MediaBrowser.Server.Mac
Task.Run (() => StartServer(CancellationToken.None));
}
private static IImageEncoder GetImageEncoder(ServerApplicationPaths appPaths, IFileSystem fileSystem, ILogManager logManager)
{
try
{
return new SkiaEncoder(logManager.GetLogger("Skia"), appPaths, () => AppHost.HttpClient, fileSystem);
}
catch (Exception ex)
{
return new NullImageEncoder();
}
}
private static void GenerateCertificate(string certPath, string certHost, string certPassword)
{
CertificateGenerator.CreateSelfSignCertificatePfx(certPath, certHost, certPassword, _logger);