diff options
Diffstat (limited to 'MediaBrowser.WebDashboard/Api/DashboardService.cs')
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/DashboardService.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 72744f249..f197914a5 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -272,6 +272,12 @@ namespace MediaBrowser.WebDashboard.Api return Path.GetExtension(path).EndsWith("html", StringComparison.OrdinalIgnoreCase); } + private void CopyFile(string src, string dst) + { + Directory.CreateDirectory(Path.GetDirectoryName(dst)); + File.Copy(src, dst, true); + } + public async Task<object> Get(GetDashboardPackage request) { var path = Path.Combine(_serverConfigurationManager.ApplicationPaths.ProgramDataPath, @@ -299,20 +305,24 @@ namespace MediaBrowser.WebDashboard.Api if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) { // Overwrite certain files with cordova specific versions - var cordovaVersion = Path.Combine(path, "thirdparty", "cordova", "registrationservices.js"); + var cordovaVersion = Path.Combine(path, "cordova", "registrationservices.js"); File.Copy(cordovaVersion, Path.Combine(path, "scripts", "registrationservices.js"), true); File.Delete(cordovaVersion); // Delete things that are unneeded in an attempt to keep the output as trim as possible Directory.Delete(Path.Combine(path, "css", "images", "tour"), true); - Directory.Delete(Path.Combine(path, "thirdparty", "apiclient", "alt"), true); + Directory.Delete(Path.Combine(path, "apiclient", "alt"), true); File.Delete(Path.Combine(path, "thirdparty", "jquerymobile-1.4.5", "jquery.mobile-1.4.5.min.map")); + + Directory.Delete(Path.Combine(path, "bower_components"), true); + // But we do need this + CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "webcomponentsjs", "webcomponents-lite.min.js"), Path.Combine(path, "bower_components", "webcomponentsjs", "webcomponents-lite.min.js")); } MinifyCssDirectory(Path.Combine(path, "css")); MinifyJsDirectory(Path.Combine(path, "scripts")); - MinifyJsDirectory(Path.Combine(path, "thirdparty", "apiclient")); + MinifyJsDirectory(Path.Combine(path, "apiclient")); MinifyJsDirectory(Path.Combine(path, "voice")); await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion); |
