diff --git a/dashboard-ui/encodingsettings.html b/dashboard-ui/encodingsettings.html index 42da151cf1..29af53fc38 100644 --- a/dashboard-ui/encodingsettings.html +++ b/dashboard-ui/encodingsettings.html @@ -19,13 +19,21 @@
Transcoding Quality Preference: - + - + - + - +

@@ -35,6 +43,27 @@
This will create very large log files and is only recommended as needed for troubleshooting purposes.
+ + +

Transcoding Temporary Path

+ diff --git a/dashboard-ui/scripts/encodingsettings.js b/dashboard-ui/scripts/encodingsettings.js index a3050c2e64..08687ae580 100644 --- a/dashboard-ui/scripts/encodingsettings.js +++ b/dashboard-ui/scripts/encodingsettings.js @@ -10,16 +10,64 @@ }).checkboxradio('refresh'); + $('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || ''); + + var transcodingTempPath = config.TranscodingTempPath ? true : false; + $('#chkEnableCustomTranscodingTempPath', page).checked(transcodingTempPath).checkboxradio("refresh"); + + if (transcodingTempPath) { + $('#fldEnterTranscodingTempPath', page).show(); + $('#txtTranscodingTempPath', page).attr("required", "required"); + } else { + $('#fldEnterTranscodingTempPath', page).hide(); + $('#txtTranscodingTempPath', page).removeAttr("required"); + } + Dashboard.hideLoadingMsg(); } - $(document).on('pageshow', "#encodingSettingsPage", function () { + $(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: "Select Transcoding Temporary Path", + + instruction: "Browse or enter the path to use for transcoding temporary files. The folder must be writeable." + }); + }); + + $('#chkEnableCustomTranscodingTempPath', page).on("change.showTranscodingTempPathText", function () { + + if (this.checked) { + $('#fldEnterTranscodingTempPath', page).show(); + $('#txtTranscodingTempPath', page).attr("required", "required"); + } else { + $('#fldEnterTranscodingTempPath', page).hide(); + $('#txtTranscodingTempPath', page).removeAttr("required"); + } + + }); + }).on('pageshow', "#encodingSettingsPage", function () { Dashboard.showLoadingMsg(); var page = this; - ApiClient.getServerConfiguration().done(function(config) { + ApiClient.getServerConfiguration().done(function (config) { loadPage(page, config); @@ -36,6 +84,12 @@ ApiClient.getServerConfiguration().done(function (config) { + if ($('#chkEnableCustomTranscodingTempPath', form).checked()) { + config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val(); + } else { + config.TranscodingTempPath = ''; + } + config.EnableDebugEncodingLogging = $('#chkEnableDebugEncodingLogging', form).checked(); config.MediaEncodingQuality = $('.radioEncodingQuality:checked', form).val();