aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/Dlna/DlnaServerService.cs1
-rw-r--r--MediaBrowser.WebDashboard/Api/PackageCreator.cs16
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj3
3 files changed, 15 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Dlna/DlnaServerService.cs b/MediaBrowser.Api/Dlna/DlnaServerService.cs
index cddb6b0ca..bdf7d6b07 100644
--- a/MediaBrowser.Api/Dlna/DlnaServerService.cs
+++ b/MediaBrowser.Api/Dlna/DlnaServerService.cs
@@ -108,6 +108,7 @@ namespace MediaBrowser.Api.Dlna
private readonly IConnectionManager _connectionManager;
private readonly IMediaReceiverRegistrar _mediaReceiverRegistrar;
+ // TODO: Add utf-8
private const string XMLContentType = "text/xml";
public DlnaServerService(IDlnaManager dlnaManager, IContentDirectory contentDirectory, IConnectionManager connectionManager, IMediaReceiverRegistrar mediaReceiverRegistrar)
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
index 091d10710..34a7f0eac 100644
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
@@ -9,6 +9,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using WebMarkupMin.Core;
using WebMarkupMin.Core.Minifiers;
using WebMarkupMin.Core.Settings;
@@ -32,9 +33,9 @@ namespace MediaBrowser.WebDashboard.Api
}
public async Task<Stream> GetResource(string path,
- string mode,
+ string mode,
string localizationCulture,
- string appVersion,
+ string appVersion,
bool enableMinification)
{
var isHtml = IsHtml(path);
@@ -58,7 +59,7 @@ namespace MediaBrowser.WebDashboard.Api
{
// Don't apply any caching for html pages
// jQuery ajax doesn't seem to handle if-modified-since correctly
- if (isHtml)
+ if (isHtml && path.IndexOf("cordovaindex.html", StringComparison.OrdinalIgnoreCase) == -1)
{
resourceStream = await ModifyHtml(resourceStream, mode, localizationCulture, enableMinification).ConfigureAwait(false);
}
@@ -137,7 +138,12 @@ namespace MediaBrowser.WebDashboard.Api
{
try
{
- var minifier = new HtmlMinifier(new HtmlMinificationSettings());
+ var minifier = new HtmlMinifier(new HtmlMinificationSettings
+ {
+ AttributeQuotesRemovalMode = HtmlAttributeQuotesRemovalMode.KeepQuotes,
+ RemoveOptionalEndTags = false,
+ RemoveTagsWithoutContent = false
+ });
var result = minifier.Minify(html, false);
if (result.Errors.Count > 0)
@@ -325,7 +331,7 @@ namespace MediaBrowser.WebDashboard.Api
{
apiClientFiles.Add("thirdparty/cordova/remotecontrols.js");
}
-
+
foreach (var file in apiClientFiles)
{
using (var fs = _fileSystem.GetFileStream(GetDashboardResourcePath(file), FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true))
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 790beba69..4b6f48c3e 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -213,6 +213,9 @@
<Content Include="dashboard-ui\thirdparty\apiclient\connectservice.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\thirdparty\cordova\cordovaindex.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\thirdparty\cordova\remotecontrols.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>