aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-08 23:48:43 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-08 23:48:43 -0400
commit0a62c66685b08c48300d558e2d4a896aff42f8eb (patch)
treefce033f8086f5b9f255e946e0d66c73e776c98fb /MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
parent58920b82adc4734c3d2f362c9d59de0dbc99bf96 (diff)
add requirejs
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index 835f3357e..041b4ea41 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Common.IO;
+using System.Globalization;
+using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
@@ -287,7 +288,9 @@ namespace MediaBrowser.Api.Playback.Progressive
var contentType = state.GetMimeType(outputPath);
- var contentLength = state.EstimateContentLength ? GetEstimatedContentLength(state) : null;
+ // TODO: The isHeadRequest is only here because ServiceStack will add Content-Length=0 to the response
+ // What we really want to do is hunt that down and remove that
+ var contentLength = state.EstimateContentLength || isHeadRequest ? GetEstimatedContentLength(state) : null;
if (contentLength.HasValue)
{
@@ -299,10 +302,14 @@ namespace MediaBrowser.Api.Playback.Progressive
{
var streamResult = ResultFactory.GetResult(new byte[] { }, contentType, responseHeaders);
- if (!contentLength.HasValue)
+ var hasOptions = streamResult as IHasOptions;
+ if (hasOptions != null)
{
- var hasOptions = streamResult as IHasOptions;
- if (hasOptions != null)
+ if (contentLength.HasValue)
+ {
+ hasOptions.Options["Content-Length"] = contentLength.Value.ToString(CultureInfo.InvariantCulture);
+ }
+ else
{
if (hasOptions.Options.ContainsKey("Content-Length"))
{