The Free Software Media System - Server Backend & API
add requirejs
Luke Pulverenti0a62c66685b0
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.csindex 835f3357eb..041b4ea41d 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.Progressivevar 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")){diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.csindex 89ae4a9b61..5c6228193e 100644--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs@@ -220,9 +220,7 @@ namespace MediaBrowser.WebDashboard.Apivar files = new[]{"thirdparty/jquerymobile-1.4.5/jquery.mobile-1.4.5.min.css",- "thirdparty/swipebox-master/css/swipebox.min.css" + versionString,"thirdparty/fontawesome/css/font-awesome.min.css" + versionString,- "thirdparty/jstree3.0.8/themes/default/style.min.css","css/all.css" + versionString};@@ -245,8 +243,7 @@ namespace MediaBrowser.WebDashboard.Apivar files = new List<string>{- "scripts/all.js" + versionString,- "thirdparty/swipebox-master/js/jquery.swipebox.min.js" + versionString+ "scripts/all.js" + versionString};if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))@@ -274,16 +271,12 @@ namespace MediaBrowser.WebDashboard.Apiawait AppendResource(memoryStream, "thirdparty/jquery-2.1.1.min.js", newLineBytes).ConfigureAwait(false);await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.5/jquery.mobile-1.4.5.min.js", newLineBytes).ConfigureAwait(false);- await AppendResource(memoryStream, "thirdparty/jquery.unveil-custom.js", newLineBytes).ConfigureAwait(false);-- await AppendResource(memoryStream, "thirdparty/cast_sender.js", newLineBytes).ConfigureAwait(false);await AppendResource(memoryStream, "thirdparty/browser.js", newLineBytes).ConfigureAwait(false);- await AppendResource(memoryStream, "thirdparty/jstree3.0.8/jstree.js", newLineBytes).ConfigureAwait(false);+ await AppendResource(memoryStream, "thirdparty/require.js", newLineBytes).ConfigureAwait(false);++ await AppendResource(memoryStream, "thirdparty/jquery.unveil-custom.js", newLineBytes).ConfigureAwait(false);- await AppendResource(memoryStream, "thirdparty/fastclick.js", newLineBytes).ConfigureAwait(false);- await AppendResource(memoryStream, "thirdparty/headroom.js", newLineBytes).ConfigureAwait(false);-await AppendLocalization(memoryStream, culture).ConfigureAwait(false);await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex 3d6d2c8d91..ce2e2d4229 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -1665,6 +1665,12 @@<Content Include="dashboard-ui\thirdparty\jstree3.0.8\themes\default\throbber.gif"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>+ <Content Include="dashboard-ui\thirdparty\require.js">+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </Content>+ <Content Include="dashboard-ui\thirdparty\requirecss.js">+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </Content><Content Include="dashboard-ui\thirdparty\swipebox-master\css\swipebox.css"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>