mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
populate quality options on sync job panel
This commit is contained in:
parent
a3e336a812
commit
58313db05a
@ -121,11 +121,7 @@
|
||||
if (result.Options.indexOf('Quality') != -1) {
|
||||
html += '<div>';
|
||||
html += '<label for="selectQuality">' + Globalize.translate('LabelQuality') + '</label>';
|
||||
html += '<select id="selectQuality" data-mini="true">';
|
||||
html += '<option value="Original">' + Globalize.translate('OptionOriginal') + '</option>';
|
||||
html += '<option value="High">' + Globalize.translate('OptionHigh') + '</option>';
|
||||
html += '<option value="Medium">' + Globalize.translate('OptionMedium') + '</option>';
|
||||
html += '<option value="Low">' + Globalize.translate('OptionLow') + '</option>';
|
||||
html += '<select id="selectQuality" data-mini="true" required="required">';
|
||||
html += '</select>';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('LabelSyncQualityHelp') + '</div>';
|
||||
html += '</div>';
|
||||
@ -180,7 +176,11 @@
|
||||
$(this).off("panelclose").remove();
|
||||
});
|
||||
|
||||
$('#selectQuality', elem).val('High').selectmenu('refresh');
|
||||
$('#selectSyncTarget', elem).on('change', function () {
|
||||
|
||||
loadQualityOptions(elem, this.value);
|
||||
|
||||
}).trigger('change');
|
||||
|
||||
$('form', elem).on('submit', function () {
|
||||
|
||||
@ -190,6 +190,25 @@
|
||||
});
|
||||
}
|
||||
|
||||
function loadQualityOptions(panel, targetId) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/QualityOptions', {
|
||||
|
||||
targetId: targetId
|
||||
|
||||
})).done(function (options) {
|
||||
|
||||
$('#selectQuality', panel).html(options.map(function (o) {
|
||||
|
||||
var selectedAttribute = o.IsDefault ? ' selected="selected"' : '';
|
||||
return '<option value="' + o.Id + '"' + selectedAttribute + '>' + o.Name + '</option>';
|
||||
|
||||
}).join('')).selectmenu('refresh');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function isAvailable(item, user) {
|
||||
|
||||
return item.SupportsSync;
|
||||
|
Loading…
Reference in New Issue
Block a user