include new setting in form load and submit

This commit is contained in:
dkanada 2019-03-05 21:38:14 +09:00
parent 141ff8887f
commit 467808a6a7
2 changed files with 4 additions and 4 deletions

View File

@ -4,6 +4,8 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb
function loadPage(page, config, languageOptions, systemInfo) { function loadPage(page, config, languageOptions, systemInfo) {
systemInfo.CanLaunchWebBrowser ? page.querySelector("#fldRunWebAppAtStartup").classList.remove("hide") : page.querySelector("#fldRunWebAppAtStartup").classList.add("hide"); systemInfo.CanLaunchWebBrowser ? page.querySelector("#fldRunWebAppAtStartup").classList.remove("hide") : page.querySelector("#fldRunWebAppAtStartup").classList.add("hide");
page.querySelector("#txtCachePath").value = config.CachePath || ""; page.querySelector("#txtCachePath").value = config.CachePath || "";
$("#txtMetadataPath", page).val(config.MetadataPath || "");
$("#txtMetadataNetworkPath", page).val(config.MetadataNetworkPath || "");
$("#selectLocalizationLanguage", page).html(languageOptions.map(function(l) { $("#selectLocalizationLanguage", page).html(languageOptions.map(function(l) {
return '<option value="' + l.Value + '">' + l.Name + "</option>" return '<option value="' + l.Value + '">' + l.Name + "</option>"
})).val(config.UICulture); })).val(config.UICulture);
@ -23,6 +25,8 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb
return ApiClient.getServerConfiguration().then(function(config) { return ApiClient.getServerConfiguration().then(function(config) {
config.UICulture = $("#selectLocalizationLanguage", form).val(); config.UICulture = $("#selectLocalizationLanguage", form).val();
config.CachePath = form.querySelector("#txtCachePath").value; config.CachePath = form.querySelector("#txtCachePath").value;
config.MetadataPath = $("#txtMetadataPath", form).val();
config.MetadataNetworkPath = $("#txtMetadataNetworkPath", form).val();
var requiresReload = false; var requiresReload = false;
if (config.UICulture !== currentLanguage) { if (config.UICulture !== currentLanguage) {
requiresReload = true; requiresReload = true;

View File

@ -4,8 +4,6 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked", "emby-checkbox", "emby-
function loadPage(page, config) { function loadPage(page, config) {
config.MergeMetadataAndImagesByName ? $(".fldImagesByName", page).hide() : $(".fldImagesByName", page).show(); config.MergeMetadataAndImagesByName ? $(".fldImagesByName", page).hide() : $(".fldImagesByName", page).show();
$("#chkSaveMetadataHidden", page).checked(config.SaveMetadataHidden); $("#chkSaveMetadataHidden", page).checked(config.SaveMetadataHidden);
$("#txtMetadataPath", page).val(config.MetadataPath || "");
$("#txtMetadataNetworkPath", page).val(config.MetadataNetworkPath || "");
loading.hide(); loading.hide();
} }
@ -54,8 +52,6 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked", "emby-checkbox", "emby-
config.EnableTvDbUpdates = $("#chkEnableTvdbUpdates", form).checked(); config.EnableTvDbUpdates = $("#chkEnableTvdbUpdates", form).checked();
config.EnableTmdbUpdates = $("#chkEnableTmdbUpdates", form).checked(); config.EnableTmdbUpdates = $("#chkEnableTmdbUpdates", form).checked();
config.EnableFanArtUpdates = $("#chkEnableFanartUpdates", form).checked(); config.EnableFanArtUpdates = $("#chkEnableFanartUpdates", form).checked();
config.MetadataPath = $("#txtMetadataPath", form).val();
config.MetadataNetworkPath = $("#txtMetadataNetworkPath", form).val();
config.FanartApiKey = $("#txtFanartApiKey", form).val(); config.FanartApiKey = $("#txtFanartApiKey", form).val();
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, onSubmitFail); ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, onSubmitFail);
}); });