1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

sync updates

This commit is contained in:
Luke Pulverenti 2015-03-15 15:10:27 -04:00
parent 249adcb2c3
commit 63d1ad89c8
2 changed files with 29 additions and 30 deletions

View file

@ -24,30 +24,17 @@
return;
}
var quality = $('#selectQuality', form).val();
if (quality == 'custom') {
quality = parseFloat($('#txtBitrate', form).val()) * 1000000;
}
var options = {
userId: userId,
TargetId: target,
Profile: $('#selectProfile', form).val() || null,
Quality: quality || null,
Name: $('#txtSyncJobName', form).val(),
SyncNewContent: $('#chkSyncNewContent', form).checked(),
UnwatchedOnly: $('#chkUnwatchedOnly', form).checked(),
ItemLimit: $('#txtItemLimit').val() || null,
ParentId: syncOptions.ParentId,
Category: syncOptions.Category
};
setJobValues(options, form);
if (syncOptions.items && syncOptions.items.length) {
options.ItemIds = (syncOptions.items || []).map(function (i) {
return i.Id || i;
@ -69,6 +56,23 @@
});
}
function setJobValues(job, form) {
var bitrate = $('#txtBitrate', form).val() || null;
if (bitrate) {
bitrate = parseFloat(bitrate) * 1000000;
}
job.Name = $('#txtSyncJobName', form).val();
job.Quality = $('#selectQuality', form).val() || null;
job.Profile = $('#selectProfile', form).val() || null;
job.Bitrate = bitrate;
job.ItemLimit = $('#txtItemLimit', form).val() || null;
job.SyncNewContent = $('#chkSyncNewContent', form).checked();
job.UnwatchedOnly = $('#chkUnwatchedOnly', form).checked();
}
function renderForm(options) {
var elem = options.elem;
@ -288,7 +292,7 @@
$('#txtBitrate', form).attr('required', 'required');
} else {
$('.fldBitrate', form).hide();
$('#txtBitrate', form).removeAttr('required');
$('#txtBitrate', form).removeAttr('required').val('');
}
}
@ -349,8 +353,8 @@
showMenu: showSyncMenu,
isAvailable: isAvailable,
renderForm: renderForm
renderForm: renderForm,
setJobValues: setJobValues
};
function showSyncButtonsPerUser(page) {