aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard/Api/DashboardService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.WebDashboard/Api/DashboardService.cs')
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 119e92cd1..715f06055 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -291,10 +291,18 @@ namespace MediaBrowser.WebDashboard.Api
var culture = "en-US";
- var appVersion = DateTime.UtcNow.Ticks.ToString(CultureInfo.InvariantCulture);
+ var appVersion = _appHost.ApplicationVersion.ToString();
var mode = request.Mode;
+ if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
+ {
+ // Overwrite certain files with cordova specific versions
+ var cordovaVersion = Path.Combine(path, "thirdparty", "cordova", "registrationservices.js");
+ File.Copy(cordovaVersion, Path.Combine(path, "scripts", "registrationservices.js"), true);
+ File.Delete(cordovaVersion);
+ }
+
await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion);
await DumpJs(creator.DashboardUIPath, path, mode, culture, appVersion);
@@ -312,6 +320,19 @@ namespace MediaBrowser.WebDashboard.Api
await DumpFile(filename, Path.Combine(destination, filename), mode, culture, appVersion).ConfigureAwait(false);
}
+
+ var excludeFiles = new List<string>();
+
+ if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
+ {
+ excludeFiles.Add("supporter.html");
+ excludeFiles.Add("supporterkey.html");
+ }
+
+ foreach (var file in excludeFiles)
+ {
+ File.Delete(Path.Combine(destination, file));
+ }
}
private async Task DumpJs(string source, string mode, string destination, string culture, string appVersion)