mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
83 lines
2.0 KiB
JavaScript
83 lines
2.0 KiB
JavaScript
(function ($, document) {
|
|
|
|
function save(page) {
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: ApiClient.getUrl("System/Configuration/SaveLocalMetadata", { Enabled: $('#chkSaveLocalMetadata', page).checked() })
|
|
|
|
}).done(function() {
|
|
|
|
|
|
// After saving chapter task, now save server config
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
config.PreferredMetadataLanguage = $('#selectLanguage', page).val();
|
|
config.MetadataCountryCode = $('#selectCountry', page).val();
|
|
|
|
ApiClient.updateServerConfiguration(config).done(function (result) {
|
|
|
|
navigateToNextPage();
|
|
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
|
|
function reloadData(page, config, cultures, countries) {
|
|
|
|
Dashboard.populateLanguages($('#selectLanguage', page), cultures);
|
|
Dashboard.populateCountries($('#selectCountry', page), countries);
|
|
|
|
$('#selectLanguage', page).val(config.PreferredMetadataLanguage).selectmenu("refresh");
|
|
$('#selectCountry', page).val(config.MetadataCountryCode).selectmenu("refresh");
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
}
|
|
|
|
function reload(page) {
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
var promise1 = ApiClient.getServerConfiguration();
|
|
var promise2 = ApiClient.getCultures();
|
|
var promise3 = ApiClient.getCountries();
|
|
|
|
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) {
|
|
|
|
reloadData(page, response1[0], response2[0], response3[0]);
|
|
|
|
});
|
|
}
|
|
|
|
function navigateToNextPage() {
|
|
|
|
Dashboard.navigate('wizardimagesettings.html');
|
|
}
|
|
|
|
$(document).on('pageshow', "#wizardSettingsPage", function () {
|
|
|
|
var page = this;
|
|
|
|
reload(page);
|
|
});
|
|
|
|
window.WizardSettingsPage = {
|
|
|
|
onSubmit: function () {
|
|
|
|
var form = this;
|
|
|
|
save(form);
|
|
|
|
return false;
|
|
}
|
|
|
|
};
|
|
|
|
})(jQuery, document, window);
|