jellyfin-web/dashboard-ui/scripts/encodingsettings.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

(function ($, document, window) {
function loadPage(page, config) {
$('#chkEnableDebugEncodingLogging', page).checked(config.EnableDebugEncodingLogging).checkboxradio('refresh');
$('.radioEncodingQuality', page).each(function() {
this.checked = config.MediaEncodingQuality == this.value;
}).checkboxradio('refresh');
$('#chkAllowUpscaling', page).checked(config.AllowVideoUpscaling).checkboxradio("refresh");
Dashboard.hideLoadingMsg();
}
2014-03-25 14:13:55 -07:00
$(document).on('pageshow', "#encodingSettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
loadPage(page, config);
});
});
window.EncodingSettingsPage = {
onSubmit: function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.AllowVideoUpscaling = $('#chkAllowUpscaling', form).checked();
config.EnableDebugEncodingLogging = $('#chkEnableDebugEncodingLogging', form).checked();
config.MediaEncodingQuality = $('.radioEncodingQuality:checked', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
};
})(jQuery, document, window);