2014-01-07 11:39:35 -07:00
|
|
|
|
(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');
|
|
|
|
|
|
2014-04-18 10:16:25 -07:00
|
|
|
|
$('#txtDownMixAudioBoost', page).val(config.DownMixAudioBoost);
|
2014-07-03 19:22:57 -07:00
|
|
|
|
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
2014-04-18 10:16:25 -07:00
|
|
|
|
|
2014-01-07 11:39:35 -07:00
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
$(document).on('pageinit', "#encodingSettingsPage", function () {
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
$('#btnSelectTranscodingTempPath', page).on("click.selectDirectory", function () {
|
|
|
|
|
|
|
|
|
|
var picker = new DirectoryBrowser(page);
|
|
|
|
|
|
|
|
|
|
picker.show({
|
|
|
|
|
|
|
|
|
|
callback: function (path) {
|
|
|
|
|
|
|
|
|
|
if (path) {
|
|
|
|
|
$('#txtTranscodingTempPath', page).val(path);
|
|
|
|
|
}
|
|
|
|
|
picker.close();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
header: Globalize.translate('HeaderSelectTranscodingPath'),
|
|
|
|
|
|
|
|
|
|
instruction: Globalize.translate('HeaderSelectTranscodingPathHelp')
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}).on('pageshow', "#encodingSettingsPage", function () {
|
2014-01-07 11:39:35 -07:00
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2014-01-11 11:58:50 -07:00
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
2014-01-07 11:39:35 -07:00
|
|
|
|
|
|
|
|
|
loadPage(page, config);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.EncodingSettingsPage = {
|
|
|
|
|
|
|
|
|
|
onSubmit: function () {
|
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var form = this;
|
|
|
|
|
|
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
|
|
|
|
|
|
config.EnableDebugEncodingLogging = $('#chkEnableDebugEncodingLogging', form).checked();
|
|
|
|
|
config.MediaEncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
2014-04-18 10:16:25 -07:00
|
|
|
|
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
|
2014-07-03 19:22:57 -07:00
|
|
|
|
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
2014-01-07 11:39:35 -07:00
|
|
|
|
|
|
|
|
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Disable default form submission
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
})(jQuery, document, window);
|