mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
rework dynamic quality options
This commit is contained in:
parent
58313db05a
commit
920da071b8
1 changed files with 9 additions and 11 deletions
|
@ -64,17 +64,17 @@
|
||||||
|
|
||||||
var userId = Dashboard.getCurrentUserId();
|
var userId = Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', {
|
var dialogOptionsQuery = {
|
||||||
|
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
ItemIds: (options.items || []).map(function (i) {
|
ItemIds: (options.items || []).map(function(i) {
|
||||||
return i.Id || i;
|
return i.Id || i;
|
||||||
}).join(','),
|
}).join(','),
|
||||||
|
|
||||||
ParentId: options.ParentId,
|
ParentId: options.ParentId,
|
||||||
Category: options.Category
|
Category: options.Category
|
||||||
|
};
|
||||||
|
|
||||||
})).done(function (result) {
|
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).done(function (result) {
|
||||||
|
|
||||||
var targets = result.Targets;
|
var targets = result.Targets;
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@
|
||||||
|
|
||||||
$('#selectSyncTarget', elem).on('change', function () {
|
$('#selectSyncTarget', elem).on('change', function () {
|
||||||
|
|
||||||
loadQualityOptions(elem, this.value);
|
loadQualityOptions(elem, this.value, dialogOptionsQuery);
|
||||||
|
|
||||||
}).trigger('change');
|
}).trigger('change');
|
||||||
|
|
||||||
|
@ -190,15 +190,13 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadQualityOptions(panel, targetId) {
|
function loadQualityOptions(panel, targetId, dialogOptionsQuery) {
|
||||||
|
|
||||||
ApiClient.getJSON(ApiClient.getUrl('Sync/QualityOptions', {
|
dialogOptionsQuery.TargetId = targetId;
|
||||||
|
|
||||||
targetId: targetId
|
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).done(function (options) {
|
||||||
|
|
||||||
})).done(function (options) {
|
$('#selectQuality', panel).html(options.QualityOptions.map(function (o) {
|
||||||
|
|
||||||
$('#selectQuality', panel).html(options.map(function (o) {
|
|
||||||
|
|
||||||
var selectedAttribute = o.IsDefault ? ' selected="selected"' : '';
|
var selectedAttribute = o.IsDefault ? ' selected="selected"' : '';
|
||||||
return '<option value="' + o.Id + '"' + selectedAttribute + '>' + o.Name + '</option>';
|
return '<option value="' + o.Id + '"' + selectedAttribute + '>' + o.Name + '</option>';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue