mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update sync
This commit is contained in:
parent
d0aee5580a
commit
0e2b46b686
47 changed files with 309 additions and 145 deletions
|
@ -90,7 +90,7 @@
|
|||
var elems = page.querySelectorAll('.chkOffline');
|
||||
for (i = 0, length = elems.length; i < length; i++) {
|
||||
|
||||
elems[i].checked = item.SyncPercent == 100;
|
||||
elems[i].checked = item.SyncPercent != null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1127,7 +1127,8 @@
|
|||
showTitle: true,
|
||||
centerText: true,
|
||||
lazy: true,
|
||||
overlayPlayButton: true
|
||||
overlayPlayButton: true,
|
||||
allowBottomPadding: !scrollX
|
||||
});
|
||||
}
|
||||
else if (item.Type == "Season") {
|
||||
|
@ -1141,7 +1142,7 @@
|
|||
overlayText: true,
|
||||
lazy: true,
|
||||
showDetailsMenu: true,
|
||||
overlayPlayButton: AppInfo.enableAppLayouts
|
||||
overlayPlayButton: AppInfo.enableAppLayouts,
|
||||
});
|
||||
}
|
||||
else if (item.Type == "GameSystem") {
|
||||
|
@ -2056,13 +2057,19 @@
|
|||
|
||||
return function (view, params) {
|
||||
|
||||
function resetSyncStatus() {
|
||||
updateSyncStatus(view, currentItem);
|
||||
}
|
||||
|
||||
function onSyncLocalClick() {
|
||||
|
||||
if (this.checked) {
|
||||
require(['syncDialog'], function (syncDialog) {
|
||||
syncDialog.showMenu({
|
||||
items: [currentItem]
|
||||
});
|
||||
}).then(function () {
|
||||
reload(view, params);
|
||||
}, resetSyncStatus);
|
||||
});
|
||||
} else {
|
||||
|
||||
|
@ -2070,10 +2077,7 @@
|
|||
|
||||
confirm(Globalize.translate('ConfirmRemoveDownload')).then(function () {
|
||||
ApiClient.cancelSyncItems([currentItem.Id]);
|
||||
}, function () {
|
||||
|
||||
updateSyncStatus(view, currentItem);
|
||||
});
|
||||
}, resetSyncStatus);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1039,8 +1039,8 @@
|
|||
var drawerWidth = screen.availWidth - 50;
|
||||
// At least 240
|
||||
drawerWidth = Math.max(drawerWidth, 240);
|
||||
// But not exceeding 270
|
||||
drawerWidth = Math.min(drawerWidth, 270);
|
||||
// But not exceeding 280
|
||||
drawerWidth = Math.min(drawerWidth, 280);
|
||||
|
||||
var disableEdgeSwipe = false;
|
||||
|
||||
|
|
|
@ -219,93 +219,96 @@
|
|||
|
||||
function showSyncMenu(options) {
|
||||
|
||||
requirejs(["registrationservices"], function () {
|
||||
RegistrationServices.validateFeature('sync').then(function () {
|
||||
showSyncMenuInternal(options);
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
requirejs(["registrationservices", 'dialogHelper', 'formDialogStyle'], function (registrationServices, dialogHelper) {
|
||||
registrationServices.validateFeature('sync').then(function () {
|
||||
|
||||
showSyncMenuInternal(dialogHelper, options).then(resolve, reject);
|
||||
|
||||
}, reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function showSyncMenuInternal(options) {
|
||||
function showSyncMenuInternal(dialogHelper, options) {
|
||||
|
||||
require(['dialogHelper', 'formDialogStyle'], function (dialogHelper) {
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
var dialogOptionsQuery = {
|
||||
UserId: userId,
|
||||
ItemIds: (options.items || []).map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(','),
|
||||
|
||||
var dialogOptionsQuery = {
|
||||
UserId: userId,
|
||||
ItemIds: (options.items || []).map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(','),
|
||||
ParentId: options.ParentId,
|
||||
Category: options.Category
|
||||
};
|
||||
|
||||
ParentId: options.ParentId,
|
||||
Category: options.Category
|
||||
};
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).then(function (dialogOptions) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).then(function (dialogOptions) {
|
||||
currentDialogOptions = dialogOptions;
|
||||
|
||||
currentDialogOptions = dialogOptions;
|
||||
|
||||
var dlg = dialogHelper.createDialog({
|
||||
size: 'small',
|
||||
removeOnClose: true,
|
||||
autoFocus: false
|
||||
});
|
||||
|
||||
dlg.classList.add('ui-body-a');
|
||||
dlg.classList.add('background-theme-a');
|
||||
dlg.classList.add('formDialog');
|
||||
|
||||
var html = '';
|
||||
html += '<div class="formDialogHeader">';
|
||||
html += '<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1"><i class="md-icon"></i></button>';
|
||||
html += '<div class="formDialogHeaderTitle">';
|
||||
html += Globalize.translate('SyncMedia');
|
||||
html += '</div>';
|
||||
|
||||
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:auto;"><button is="emby-button" type="button" class="mini"><i class="md-icon">info</i><span>' + Globalize.translate('ButtonHelp') + '</span></button></a>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="formDialogContent smoothScrollY" style="padding-top:2em;">';
|
||||
html += '<div class="dialogContentInner dialog-content-centered">';
|
||||
|
||||
html += '<form class="formSubmitSyncRequest" style="margin: auto;">';
|
||||
|
||||
html += '<div class="formFields"></div>';
|
||||
|
||||
html += '<p>';
|
||||
html += '<button is="emby-button" type="submit" class="raised submit block"><i class="md-icon">sync</i><span>' + Globalize.translate('ButtonSync') + '</span></button>';
|
||||
html += '</p>';
|
||||
|
||||
html += '</form>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
|
||||
dlg.innerHTML = html;
|
||||
document.body.appendChild(dlg);
|
||||
|
||||
dialogHelper.open(dlg);
|
||||
|
||||
$('form', dlg).on('submit', function () {
|
||||
|
||||
submitJob(dlg, userId, options, this, dialogHelper);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.btnCancel', dlg).on('click', function () {
|
||||
dialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
renderForm({
|
||||
elem: $('.formFields', dlg),
|
||||
dialogOptions: dialogOptions,
|
||||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptionsQuery)
|
||||
});
|
||||
var dlg = dialogHelper.createDialog({
|
||||
size: 'small',
|
||||
removeOnClose: true,
|
||||
autoFocus: false
|
||||
});
|
||||
|
||||
dlg.classList.add('ui-body-a');
|
||||
dlg.classList.add('background-theme-a');
|
||||
dlg.classList.add('formDialog');
|
||||
|
||||
var html = '';
|
||||
html += '<div class="formDialogHeader">';
|
||||
html += '<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1"><i class="md-icon"></i></button>';
|
||||
html += '<div class="formDialogHeaderTitle">';
|
||||
html += Globalize.translate('SyncMedia');
|
||||
html += '</div>';
|
||||
|
||||
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:auto;"><button is="emby-button" type="button" class="mini"><i class="md-icon">info</i><span>' + Globalize.translate('ButtonHelp') + '</span></button></a>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="formDialogContent smoothScrollY" style="padding-top:2em;">';
|
||||
html += '<div class="dialogContentInner dialog-content-centered">';
|
||||
|
||||
html += '<form class="formSubmitSyncRequest" style="margin: auto;">';
|
||||
|
||||
html += '<div class="formFields"></div>';
|
||||
|
||||
html += '<p>';
|
||||
html += '<button is="emby-button" type="submit" class="raised submit block"><i class="md-icon">sync</i><span>' + Globalize.translate('ButtonSync') + '</span></button>';
|
||||
html += '</p>';
|
||||
|
||||
html += '</form>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
|
||||
dlg.innerHTML = html;
|
||||
document.body.appendChild(dlg);
|
||||
|
||||
$('form', dlg).on('submit', function () {
|
||||
|
||||
submitJob(dlg, userId, options, this, dialogHelper);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.btnCancel', dlg).on('click', function () {
|
||||
dialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
var promise = dialogHelper.open(dlg);
|
||||
|
||||
renderForm({
|
||||
elem: $('.formFields', dlg),
|
||||
dialogOptions: dialogOptions,
|
||||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptionsQuery)
|
||||
});
|
||||
|
||||
return promise;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue