aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-22 15:16:14 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-22 15:16:14 -0400
commitc7171177b93a846425d5344c3707fd0b90cad9e9 (patch)
tree43890f531c6e829443dcfdc3a68243bf3d6e4340
parentae768735aa3755083321d1c9975a8b3fcf644b31 (diff)
lazy load scripts
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs2
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs1
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs29
-rw-r--r--MediaBrowser.WebDashboard/Api/PackageCreator.cs5
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj3
5 files changed, 26 insertions, 14 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index 80079adf4..8c6cc0a18 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -625,6 +625,8 @@ namespace MediaBrowser.Api.Images
var file = await _imageProcessor.ProcessImage(options).ConfigureAwait(false);
+ headers["Vary"] = "Accept";
+
return ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions
{
CacheDuration = cacheDuration,
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 0117f4129..6ca489f6d 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -483,6 +483,7 @@ namespace MediaBrowser.MediaEncoding.Probing
FetchStudios(audio, tags, "organization");
FetchStudios(audio, tags, "ensemble");
FetchStudios(audio, tags, "publisher");
+ FetchStudios(audio, tags, "label");
// These support mulitple values, but for now we only store the first.
audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id")));
diff --git a/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs b/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs
index 23ecde191..c47332dbe 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs
@@ -45,19 +45,15 @@ namespace MediaBrowser.Server.Implementations.HttpServer
}
}
- if (dto is CompressedResult)
- {
- // Per Google PageSpeed
- // This instructs the proxies to cache two versions of the resource: one compressed, and one uncompressed.
- // The correct version of the resource is delivered based on the client request header.
- // This is a good choice for applications that are singly homed and depend on public proxies for user locality.
- res.AddHeader("Vary", "Accept-Encoding");
- }
+ var vary = "Accept-Encoding";
var hasOptions = dto as IHasOptions;
+ var sharpResponse = res as WebSocketSharpResponse;
if (hasOptions != null)
{
+ //hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1";
+
// Content length has to be explicitly set on on HttpListenerResponse or it won't be happy
string contentLength;
@@ -79,14 +75,29 @@ namespace MediaBrowser.Server.Implementations.HttpServer
return;
}
- var sharpResponse = res as WebSocketSharpResponse;
if (sharpResponse != null)
{
sharpResponse.SendChunked = false;
}
}
}
+
+ string hasOptionsVary;
+ if (hasOptions.Options.TryGetValue("Vary", out hasOptionsVary))
+ {
+ vary = hasOptionsVary;
+ }
+
+ hasOptions.Options["Vary"] = vary;
}
+
+ //res.KeepAlive = false;
+
+ // Per Google PageSpeed
+ // This instructs the proxies to cache two versions of the resource: one compressed, and one uncompressed.
+ // The correct version of the resource is delivered based on the client request header.
+ // This is a good choice for applications that are singly homed and depend on public proxies for user locality.
+ res.AddHeader("Vary", vary);
}
/// <summary>
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
index a414e4131..13234888c 100644
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
@@ -590,12 +590,7 @@ namespace MediaBrowser.WebDashboard.Api
"kids.js",
"librarypathmapping.js",
"librarysettings.js",
- "livetvchannel.js",
- "livetvguide.js",
- "livetvnewrecording.js",
- "livetvprogram.js",
"livetvrecording.js",
- "livetvrecordinglist.js",
"livetvtimer.js",
"livetvseriestimer.js",
"livetvsettings.js",
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index b7ecd58a5..acac62471 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -150,6 +150,9 @@
<Content Include="dashboard-ui\scripts\kids.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\scripts\livetvcomponents.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\scripts\livetvitems.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>