The Free Software Media System - Server Backend & API
Added IHttpResultFactory
LukePulverenti332f6359398b
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csprojindex 578a76a30f..b1c40e3dca 100644--- a/MediaBrowser.Common/MediaBrowser.Common.csproj+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj@@ -61,6 +61,7 @@<Compile Include="IO\StreamDefaults.cs" /><Compile Include="Net\BasePeriodicWebSocketListener.cs" /><Compile Include="Configuration\IApplicationPaths.cs" />+ <Compile Include="Net\IHttpResultFactory.cs" /><Compile Include="Net\IServerManager.cs" /><Compile Include="Net\IWebSocketListener.cs" /><Compile Include="IApplicationHost.cs" />diff --git a/MediaBrowser.Common/Net/IHttpResultFactory.cs b/MediaBrowser.Common/Net/IHttpResultFactory.csnew file mode 100644index 0000000000..565a2dce9c--- /dev/null+++ b/MediaBrowser.Common/Net/IHttpResultFactory.cs@@ -0,0 +1,9 @@+using System.IO;++namespace MediaBrowser.Common.Net+{+ public interface IHttpResultFactory+ {+ object GetResult(Stream stream, string contentType);+ }+}diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.csnew file mode 100644index 0000000000..2dd968988c--- /dev/null+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs@@ -0,0 +1,14 @@+using MediaBrowser.Common.Net;+using ServiceStack.Common.Web;+using System.IO;++namespace MediaBrowser.Server.Implementations.HttpServer+{+ public class HttpResultFactory : IHttpResultFactory+ {+ public object GetResult(Stream stream, string contentType)+ {+ return new HttpResult(stream, contentType);+ }+ }+}diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csprojindex 7810886723..0b9f7c7e13 100644--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj@@ -106,6 +106,7 @@<Compile Include="BdInfo\BdInfoExaminer.cs" /><Compile Include="Configuration\ServerConfigurationManager.cs" /><Compile Include="HttpServer\BaseRestService.cs" />+ <Compile Include="HttpServer\HttpResultFactory.cs" /><Compile Include="HttpServer\HttpServer.cs" /><Compile Include="HttpServer\NativeWebSocket.cs" /><Compile Include="HttpServer\ServerFactory.cs" />diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.csindex 2eccee0665..179a2e2402 100644--- a/MediaBrowser.ServerApplication/ApplicationHost.cs+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs@@ -155,6 +155,8 @@ namespace MediaBrowser.ServerApplicationawait base.RegisterResources().ConfigureAwait(false);+ RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory());+RegisterSingleInstance<IServerApplicationHost>(this);RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths);