mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update path configs
This commit is contained in:
parent
e8b542348f
commit
b1a7dbd507
4 changed files with 62 additions and 22 deletions
|
@ -29,11 +29,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="checkboxContainer">
|
<div class="checkboxContainer">
|
||||||
<label>
|
<label>
|
||||||
<input is="emby-checkbox" type="checkbox" id="chkEnableThrottle" />
|
<input is="emby-checkbox" type="checkbox" id="chkEnableThrottle"/>
|
||||||
<span>${OptionEnableTranscodingThrottle}</span>
|
<span>${OptionEnableTranscodingThrottle}</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="fieldDescription checkboxFieldDescription">${OptionEnableTranscodingThrottleHelp}</div>
|
<div class="fieldDescription checkboxFieldDescription">${OptionEnableTranscodingThrottleHelp}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="selectContainer fldSelectEncoderPathType hide">
|
||||||
|
<select is="emby-select" id="selectEncoderPath" label="${LabelffmpegVersion}">
|
||||||
|
<option value="System">${OptionUseSystemInstalledVersion}</option>
|
||||||
|
<option value="Custom">${OptionUseMyCustomVersion}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="inputContainer fldEncoderPath hide">
|
<div class="inputContainer fldEncoderPath hide">
|
||||||
<div style="display: flex; align-items: center;">
|
<div style="display: flex; align-items: center;">
|
||||||
<div style="flex-grow:1;">
|
<div style="flex-grow:1;">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
define(['jQuery'], function ($) {
|
define(['jQuery'], function ($) {
|
||||||
|
|
||||||
function loadPage(page, config) {
|
function loadPage(page, config, systemInfo) {
|
||||||
|
|
||||||
page.querySelector('#chkEnableThrottle').checked = config.EnableThrottling;
|
page.querySelector('#chkEnableThrottle').checked = config.EnableThrottling;
|
||||||
|
|
||||||
|
@ -10,6 +10,11 @@
|
||||||
page.querySelector('.txtEncoderPath').value = config.EncoderAppPath || '';
|
page.querySelector('.txtEncoderPath').value = config.EncoderAppPath || '';
|
||||||
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
||||||
|
|
||||||
|
var selectEncoderPath = page.querySelector('#selectEncoderPath');
|
||||||
|
|
||||||
|
selectEncoderPath.value = systemInfo.EncoderLocationType;
|
||||||
|
onSelectEncoderPathChange.call(selectEncoderPath);
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +32,25 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateEncoder(form) {
|
||||||
|
|
||||||
|
return ApiClient.getSystemInfo().then(function(systemInfo) {
|
||||||
|
|
||||||
|
if (systemInfo.EncoderLocationType == "External") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiClient.ajax({
|
||||||
|
url: ApiClient.getUrl('System/MediaEncoder/Path'),
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
Path: form.querySelector('.txtEncoderPath').value,
|
||||||
|
PathType: form.querySelector('#selectEncoderPath').value
|
||||||
|
}
|
||||||
|
}).then(Dashboard.processServerConfigurationUpdateResult, onSaveEncodingPathFailure);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
|
|
||||||
var form = this;
|
var form = this;
|
||||||
|
@ -45,14 +69,7 @@
|
||||||
|
|
||||||
ApiClient.updateNamedConfiguration("encoding", config).then(function () {
|
ApiClient.updateNamedConfiguration("encoding", config).then(function () {
|
||||||
|
|
||||||
ApiClient.ajax({
|
updateEncoder(form);
|
||||||
url: ApiClient.getUrl('System/MediaEncoder/Path'),
|
|
||||||
type: 'POST',
|
|
||||||
data: {
|
|
||||||
Path: form.querySelector('.txtEncoderPath').value
|
|
||||||
}
|
|
||||||
}).then(Dashboard.processServerConfigurationUpdateResult, onSaveEncodingPathFailure);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -95,6 +112,17 @@
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSelectEncoderPathChange(e) {
|
||||||
|
|
||||||
|
var page = $(this).parents('.page')[0];
|
||||||
|
|
||||||
|
if (this.value == 'Custom') {
|
||||||
|
page.querySelector('.fldEncoderPath').classList.remove('hide');
|
||||||
|
} else {
|
||||||
|
page.querySelector('.fldEncoderPath').classList.add('hide');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#encodingSettingsPage", function () {
|
$(document).on('pageinit', "#encodingSettingsPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
@ -144,6 +172,7 @@
|
||||||
|
|
||||||
$('.encodingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
$('.encodingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
|
|
||||||
|
page.querySelector('#selectEncoderPath').addEventListener('change', onSelectEncoderPathChange);
|
||||||
|
|
||||||
}).on('pageshow', "#encodingSettingsPage", function () {
|
}).on('pageshow', "#encodingSettingsPage", function () {
|
||||||
|
|
||||||
|
@ -154,17 +183,17 @@
|
||||||
|
|
||||||
ApiClient.getNamedConfiguration("encoding").then(function (config) {
|
ApiClient.getNamedConfiguration("encoding").then(function (config) {
|
||||||
|
|
||||||
loadPage(page, config);
|
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||||
|
|
||||||
|
if (systemInfo.EncoderLocationType == "External") {
|
||||||
|
page.querySelector('.fldSelectEncoderPathType').classList.add('hide');
|
||||||
|
} else {
|
||||||
|
page.querySelector('.fldSelectEncoderPathType').classList.remove('hide');
|
||||||
|
}
|
||||||
|
loadPage(page, config, systemInfo);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
|
||||||
|
|
||||||
if (systemInfo.HasExternalEncoder) {
|
|
||||||
page.querySelector('.fldEncoderPath').classList.add('hide');
|
|
||||||
} else {
|
|
||||||
page.querySelector('.fldEncoderPath').classList.remove('hide');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="https://ffmpeg.zeranoe.com/builds">https://ffmpeg.zeranoe.com</a>');
|
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="https://ffmpeg.zeranoe.com/builds">https://ffmpeg.zeranoe.com</a>');
|
||||||
|
|
||||||
if (systemInfo.SystemArchitecture == 'X86') {
|
if (systemInfo.SystemArchitecture == 'X86') {
|
||||||
instructions = 'Download 32-Bit Static';
|
instructions = 'Download FFmpeg 32-Bit Static';
|
||||||
}
|
}
|
||||||
else if (systemInfo.SystemArchitecture == 'X64') {
|
else if (systemInfo.SystemArchitecture == 'X64') {
|
||||||
instructions = 'Download 64-Bit Static';
|
instructions = 'Download FFmpeg 64-Bit Static';
|
||||||
}
|
}
|
||||||
|
|
||||||
view.querySelector('.downloadInstructions').innerHTML = instructions;
|
view.querySelector('.downloadInstructions').innerHTML = instructions;
|
||||||
|
@ -90,7 +90,8 @@
|
||||||
url: ApiClient.getUrl('System/MediaEncoder/Path'),
|
url: ApiClient.getUrl('System/MediaEncoder/Path'),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: {
|
||||||
Path: form.querySelector('.txtEncoderPath').value
|
Path: form.querySelector('.txtEncoderPath').value,
|
||||||
|
PathType: 'Custom'
|
||||||
}
|
}
|
||||||
}).then(goNext, onSaveEncodingPathFailure);
|
}).then(goNext, onSaveEncodingPathFailure);
|
||||||
|
|
||||||
|
|
|
@ -2374,6 +2374,7 @@
|
||||||
"SettingsWarning": "Changing these values may cause instability or connectivity failures. If you experience any problems, we recommend changing them back to default.",
|
"SettingsWarning": "Changing these values may cause instability or connectivity failures. If you experience any problems, we recommend changing them back to default.",
|
||||||
"MapChannels": "Map Channels",
|
"MapChannels": "Map Channels",
|
||||||
"LabelffmpegPath": "FFmpeg path:",
|
"LabelffmpegPath": "FFmpeg path:",
|
||||||
|
"LabelffmpegVersion": "FFmpeg version:",
|
||||||
"LabelffmpegPathHelp": "The path to your downloaded FFmpeg application, or folder containing FFmpeg.",
|
"LabelffmpegPathHelp": "The path to your downloaded FFmpeg application, or folder containing FFmpeg.",
|
||||||
"SetupFFmpeg": "Setup FFmpeg",
|
"SetupFFmpeg": "Setup FFmpeg",
|
||||||
"SetupFFmpegHelp": "FFmpeg is a required component and needs to be configured.",
|
"SetupFFmpegHelp": "FFmpeg is a required component and needs to be configured.",
|
||||||
|
@ -2381,5 +2382,7 @@
|
||||||
"DownloadFFmpeg": "Download FFmpeg",
|
"DownloadFFmpeg": "Download FFmpeg",
|
||||||
"FFmpegSuggestedDownload": "Suggested download: {0}",
|
"FFmpegSuggestedDownload": "Suggested download: {0}",
|
||||||
"UnzipFFmpegFile": "Unzip the downloaded file to a folder of your choice.",
|
"UnzipFFmpegFile": "Unzip the downloaded file to a folder of your choice.",
|
||||||
|
"OptionUseSystemInstalledVersion": "Use system installed version",
|
||||||
|
"OptionUseMyCustomVersion": "Use a custom version",
|
||||||
"FFmpegSavePathNotFound": "We're unable to locaate FFmpeg using the path you've entered. FFprobe is also required and must exist in the same folder. These components are normally bundled together in the same download. Please check the path and try again."
|
"FFmpegSavePathNotFound": "We're unable to locaate FFmpeg using the path you've entered. FFprobe is also required and must exist in the same folder. These components are normally bundled together in the same download. Please check the path and try again."
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue