mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-29 20:24:47 +03:00
vulcanize
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user