diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index 578a76a30..b1c40e3dc 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -61,6 +61,7 @@ + diff --git a/MediaBrowser.Common/Net/IHttpResultFactory.cs b/MediaBrowser.Common/Net/IHttpResultFactory.cs new file mode 100644 index 000000000..565a2dce9 --- /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.cs new file mode 100644 index 000000000..2dd968988 --- /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.csproj index 781088672..0b9f7c7e1 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -106,6 +106,7 @@ + diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 2eccee066..179a2e240 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -155,6 +155,8 @@ namespace MediaBrowser.ServerApplication await base.RegisterResources().ConfigureAwait(false); + RegisterSingleInstance(new HttpResultFactory()); + RegisterSingleInstance(this); RegisterSingleInstance(ApplicationPaths);