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-01-20 22:54:45 -05:00
parent e82017b591
commit 0022427719
3 changed files with 54 additions and 8 deletions

View file

@ -66,8 +66,7 @@
html += '<li class="' + cssClass + '"' + ' data-itemid="' + jobItem.Id + '" data-status="' + jobItem.Status + '">';
var hasActions = jobItem.Status != 'RemovedFromDevice';
hasActions = false;
var hasActions = ['Queued', 'Cancelled', 'Failed', 'Transferring', 'Converting'].indexOf(jobItem.Status) != -1;
html += '<a href="#">';
@ -156,8 +155,14 @@
html += '<ul data-role="listview" style="min-width: 180px;">';
html += '<li data-role="list-divider">' + Globalize.translate('HeaderMenu') + '</li>';
if (status != 'Cancelled' && status != 'RemovedFromDevice' && status != 'Failed') {
html += '<li data-icon="delete"><a href="#" class="btnCancelJob" data-id="' + id + '">' + Globalize.translate('ButtonCancel') + '</a></li>';
if (status == 'Failed') {
html += '<li data-icon="check"><a href="#" class="btnRetryJobItem" data-id="' + id + '">' + Globalize.translate('ButtonQueueForRetry') + '</a></li>';
}
else if (status == 'Cancelled') {
html += '<li data-icon="check"><a href="#" class="btnRetryJobItem" data-id="' + id + '">' + Globalize.translate('ButtonReenable') + '</a></li>';
}
else if (status == 'Queued' || status == 'Transferring' || status == 'Converting') {
html += '<li data-icon="delete"><a href="#" class="btnCancelJobItem" data-id="' + id + '">' + Globalize.translate('ButtonCancelItem') + '</a></li>';
}
html += '</ul>';
@ -172,8 +177,47 @@
});
$('.btnCancelJob', flyout).on('click', function () {
//cancelJob(page, this.getAttribute('data-id'));
$('.btnCancelJobItem', flyout).on('click', function () {
cancelJobItem(page, this.getAttribute('data-id'));
});
$('.btnRetryJobItem', flyout).on('click', function () {
retryJobItem(page, this.getAttribute('data-id'));
});
}
function cancelJobItem(page, jobItemId) {
$('.jobMenu', page).popup('close');
// Need a timeout because jquery mobile will not show a popup while another is in the act of closing
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: "DELETE",
url: ApiClient.getUrl('Sync/JobItems/' + jobItemId)
}).done(function () {
loadJob(page);
});
}
function retryJobItem(page, jobItemId) {
$('.jobMenu', page).popup('close');
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl('Sync/JobItems/' + jobItemId + '/Enable')
}).done(function () {
loadJob(page);
});
}

View file

@ -120,6 +120,7 @@
return this.getAttribute('data-id');
}).get();
user.Policy.BlockedMediaFolders = null;
user.Policy.EnableAllChannels = $('#chkEnableAllChannels', page).checked();
user.Policy.EnabledChannels = user.Policy.EnableAllChannels ?
@ -129,6 +130,7 @@
return this.getAttribute('data-id');
}).get();
user.Policy.BlockedChannels = null;
user.Policy.EnableAllDevices = $('#chkEnableAllDevices', page).checked();
user.Policy.EnabledDevices = user.Policy.EnableAllDevices ?

View file

@ -1491,9 +1491,9 @@
/**
* Gets the virtual folder list
*/
self.getVirtualFolders = function (userId) {
self.getVirtualFolders = function () {
var url = userId ? "Users/" + userId + "/VirtualFolders" : "Library/VirtualFolders";
var url = "Library/VirtualFolders";
url = self.getUrl(url);