aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-12 15:56:12 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-12 15:56:12 -0400
commitc4f587dd94a4f21e033a6643493a76e5838f283e (patch)
tree933a8cd882c0ab8bdb2f63ac39c93f76ff3ce8e3 /MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
parenta5b807e433f0d41349ed9dab8911aa4a6f55cbab (diff)
live tv stream adjustments, add additional dlna params
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
index 8455d9f58..925ef8050 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -306,6 +306,18 @@ namespace MediaBrowser.Server.Implementations.HttpServer
throw new ArgumentNullException("path");
}
+ return GetStaticFileResult(requestContext, path, MimeTypes.GetMimeType(path), fileShare, responseHeaders, isHeadRequest);
+ }
+
+ public object GetStaticFileResult(IRequest requestContext, string path, string contentType,
+ FileShare fileShare = FileShare.Read, IDictionary<string, string> responseHeaders = null,
+ bool isHeadRequest = false)
+ {
+ if (string.IsNullOrEmpty(path))
+ {
+ throw new ArgumentNullException("path");
+ }
+
if (fileShare != FileShare.Read && fileShare != FileShare.ReadWrite)
{
throw new ArgumentException("FileShare must be either Read or ReadWrite");
@@ -315,7 +327,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
var cacheKey = path + dateModified.Ticks;
- return GetStaticResult(requestContext, cacheKey.GetMD5(), dateModified, null, MimeTypes.GetMimeType(path), () => Task.FromResult(GetFileStream(path, fileShare)), responseHeaders, isHeadRequest);
+ return GetStaticResult(requestContext, cacheKey.GetMD5(), dateModified, null, contentType, () => Task.FromResult(GetFileStream(path, fileShare)), responseHeaders, isHeadRequest);
}
/// <summary>