mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
sync updates
This commit is contained in:
parent
7c25aaa69a
commit
ae74dfb031
4 changed files with 84 additions and 20 deletions
|
@ -40,7 +40,8 @@
|
|||
Name: $('#txtSyncJobName', form).val(),
|
||||
|
||||
SyncNewContent: $('#chkSyncNewContent', form).checked(),
|
||||
UnwatchedOnly: $('#chkUnwatchedOnly', form).checked()
|
||||
UnwatchedOnly: $('#chkUnwatchedOnly', form).checked(),
|
||||
ItemLimit: $('#txtItemLimit').val() || null
|
||||
};
|
||||
|
||||
ApiClient.ajax({
|
||||
|
@ -62,11 +63,16 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Targets', {
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', {
|
||||
|
||||
UserId: userId
|
||||
UserId: userId,
|
||||
ItemIds: options.items.map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(',')
|
||||
|
||||
})).done(function (targets) {
|
||||
})).done(function (result) {
|
||||
|
||||
var targets = result.Targets;
|
||||
|
||||
var html = '<div data-role="panel" data-position="right" data-display="overlay" class="syncPanel" data-position-fixed="true" data-theme="a">';
|
||||
|
||||
|
@ -75,7 +81,7 @@
|
|||
|
||||
html += '<form class="formSubmitSyncRequest">';
|
||||
|
||||
if (options.items.length > 1) {
|
||||
if (result.Options.indexOf('Name') != -1) {
|
||||
|
||||
html += '<p>';
|
||||
html += '<label for="txtSyncJobName">' + Globalize.translate('LabelSyncJobName') + '</label>';
|
||||
|
@ -119,19 +125,32 @@
|
|||
//html += '<h2>' + Globalize.translate('HeaderSettings') + '</h2>';
|
||||
//html += '<div style="margin:0 -.5em 0 -.25em;">';
|
||||
|
||||
html += '<br/>';
|
||||
html += '<div>';
|
||||
html += '<label for="chkSyncNewContent">' + Globalize.translate('OptionAutomaticallySyncNewContent') + '</label>';
|
||||
html += '<input type="checkbox" id="chkSyncNewContent" data-mini="true" />';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('OptionAutomaticallySyncNewContentHelp') + '</div>';
|
||||
html += '</div>';
|
||||
if (result.Options.indexOf('UnwatchedOnly') != -1) {
|
||||
html += '<br/>';
|
||||
html += '<div>';
|
||||
html += '<label for="chkUnwatchedOnly">' + Globalize.translate('OptionSyncUnwatchedVideosOnly') + '</label>';
|
||||
html += '<input type="checkbox" id="chkUnwatchedOnly" data-mini="true" />';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('OptionSyncUnwatchedVideosOnlyHelp') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '<br/>';
|
||||
html += '<div>';
|
||||
html += '<label for="chkUnwatchedOnly">' + Globalize.translate('OptionSyncUnwatchedVideosOnly') + '</label>';
|
||||
html += '<input type="checkbox" id="chkUnwatchedOnly" data-mini="true" />';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('OptionSyncUnwatchedVideosOnlyHelp') + '</div>';
|
||||
html += '</div>';
|
||||
if (result.Options.indexOf('SyncNewContent') != -1) {
|
||||
html += '<br/>';
|
||||
html += '<div>';
|
||||
html += '<label for="chkSyncNewContent">' + Globalize.translate('OptionAutomaticallySyncNewContent') + '</label>';
|
||||
html += '<input type="checkbox" id="chkSyncNewContent" data-mini="true" />';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('OptionAutomaticallySyncNewContentHelp') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
if (result.Options.indexOf('ItemLimit') != -1) {
|
||||
html += '<br/>';
|
||||
html += '<div>';
|
||||
html += '<label for="txtItemLimit">' + Globalize.translate('LabelItemLimit') + '</label>';
|
||||
html += '<input type="number" id="txtItemLimit" data-mini="true" step="1" min="1" />';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('LabelItemLimitHelp') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
//html += '</div>';
|
||||
//html += '</div>';
|
||||
|
@ -159,6 +178,33 @@
|
|||
});
|
||||
}
|
||||
|
||||
function showUnwatchedFilter(items) {
|
||||
|
||||
return items.filter(function (i) {
|
||||
|
||||
return i.MediaType == "Video" || i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist";
|
||||
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
function showItemLimit(items) {
|
||||
|
||||
return items.length > 1 || items.filter(function (i) {
|
||||
|
||||
return i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist";
|
||||
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
function showSyncNew(items) {
|
||||
|
||||
return items.filter(function (i) {
|
||||
|
||||
return i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist";
|
||||
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
function isAvailable(item, user) {
|
||||
|
||||
//return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue