diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 386a387f5c..c6155b1b33 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -340,11 +340,9 @@ namespace MediaBrowser.WebDashboard.Api
CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "headroom.js", "dist", "headroom.min.js"), Path.Combine(path, "bower_components", "headroom.js", "dist", "headroom.min.js"));
CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "isMobile", "isMobile.min.js"), Path.Combine(path, "bower_components", "isMobile", "isMobile.min.js"));
}
-
- MinifyCssDirectory(Path.Combine(path, "css"));
- MinifyJsDirectory(Path.Combine(path, "scripts"));
- MinifyJsDirectory(Path.Combine(path, "apiclient"));
- MinifyJsDirectory(Path.Combine(path, "voice"));
+
+ MinifyCssDirectory(path);
+ MinifyJsDirectory(path);
await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion);
await DumpJs(creator.DashboardUIPath, path, mode, culture, appVersion);
@@ -358,6 +356,15 @@ namespace MediaBrowser.WebDashboard.Api
{
foreach (var file in Directory.GetFiles(path, "*.css", SearchOption.AllDirectories))
{
+ if (file.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ continue;
+ }
+ if (file.IndexOf("bower_", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ continue;
+ }
+
try
{
var text = _fileSystem.ReadAllText(file, Encoding.UTF8);
@@ -385,6 +392,15 @@ namespace MediaBrowser.WebDashboard.Api
{
foreach (var file in Directory.GetFiles(path, "*.js", SearchOption.AllDirectories))
{
+ if (file.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ continue;
+ }
+ if (file.IndexOf("bower_", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ continue;
+ }
+
try
{
var text = _fileSystem.ReadAllText(file, Encoding.UTF8);
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
index a01430840b..56344d2990 100644
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
@@ -65,14 +65,14 @@ namespace MediaBrowser.WebDashboard.Api
}
else if (IsFormat(path, "js"))
{
- if (path.IndexOf("thirdparty", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
+ if (path.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
{
resourceStream = await ModifyJs(resourceStream, enableMinification).ConfigureAwait(false);
}
}
else if (IsFormat(path, "css"))
{
- if (path.IndexOf("thirdparty", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
+ if (path.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
{
resourceStream = await ModifyCss(resourceStream, enableMinification).ConfigureAwait(false);
}
@@ -461,31 +461,6 @@ namespace MediaBrowser.WebDashboard.Api
return builder.ToString();
}
- ///
- /// Appends the resource.
- ///
- /// The output stream.
- /// The path.
- /// The new line bytes.
- /// Task.
- private async Task AppendResource(Stream outputStream, string path, byte[] newLineBytes)
- {
- path = GetDashboardResourcePath(path);
-
- using (var fs = _fileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true))
- {
- using (var streamReader = new StreamReader(fs))
- {
- var text = await streamReader.ReadToEndAsync().ConfigureAwait(false);
- var bytes = Encoding.UTF8.GetBytes(text);
- await outputStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
- }
- }
-
- await outputStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
- }
-
-
///
/// Gets all CSS.
///
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index b5879836f6..aa74e59664 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -245,6 +245,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -528,6 +531,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -1249,9 +1255,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest