mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
more sync movement
This commit is contained in:
parent
ebe849f9b0
commit
a2b7ece263
21 changed files with 128 additions and 85 deletions
|
@ -1,25 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleServer}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="dashboardSyncPage" data-role="page" class="page type-interior devicesPage">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="devices.html" data-role="button">${TabDevices}</a>
|
||||
<a href="devicesupload.html" data-role="button">${TabCameraUpload}</a>
|
||||
<a href="dashboardsync.html" data-role="button" class="ui-btn-active">${TabSync}</a>
|
||||
</div>
|
||||
|
||||
<div class="syncActivity">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -12,7 +12,6 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabDevices}</a>
|
||||
<a href="devicesupload.html" data-role="button">${TabCameraUpload}</a>
|
||||
<a href="dashboardsync.html" data-role="button">${TabSync}</a>
|
||||
</div>
|
||||
|
||||
<div class="readOnlyContent">
|
||||
|
|
|
@ -79,11 +79,11 @@
|
|||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Devices', {
|
||||
|
||||
SupportsDeviceId: true
|
||||
SupportsUniqueIdentifier: true
|
||||
|
||||
})).done(function (devices) {
|
||||
})).done(function (result) {
|
||||
|
||||
load(page, devices);
|
||||
load(page, result.Items);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
||||
|
||||
load(page, response2[0], response1[0]);
|
||||
load(page, response2[0].Items, response1[0]);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'List');
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster');
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
|
|
@ -1543,7 +1543,9 @@
|
|||
|
||||
$('.btnSync', page).on('click', function () {
|
||||
|
||||
SyncManager.showMenu([currentItem]);
|
||||
SyncManager.showMenu({
|
||||
items: [currentItem]
|
||||
});
|
||||
});
|
||||
|
||||
$('.btnMoreCommands', page).on('click', function () {
|
||||
|
|
|
@ -251,9 +251,8 @@
|
|||
|
||||
closeContextMenu();
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
||||
|
||||
SyncManager.showMenu([item]);
|
||||
SyncManager.showMenu({
|
||||
items: [id]
|
||||
});
|
||||
|
||||
return false;
|
||||
|
@ -743,22 +742,14 @@
|
|||
return;
|
||||
}
|
||||
|
||||
ApiClient.getItems({
|
||||
|
||||
ids: selection.join(','),
|
||||
fields: 'SyncInfo',
|
||||
userId: Dashboard.getCurrentUserId()
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
SyncManager.showMenu(result.Items);
|
||||
SyncManager.showMenu({
|
||||
items: selection
|
||||
});
|
||||
|
||||
$(SyncManager).off('jobsubmit.librarylist').on('jobsubmit.librarylist', function () {
|
||||
|
||||
hideSelections(page);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function combineVersions(page) {
|
||||
|
|
|
@ -925,6 +925,15 @@
|
|||
Limit: itemLimit
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.Type == "Playlist") {
|
||||
|
||||
promise = ApiClient.getInstantMixFromPlaylist(id, {
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
Fields: getItemFields,
|
||||
Limit: itemLimit
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.Type == "Audio") {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'List');
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster');
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'List');
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster');
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 12 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 6 : 3)),
|
||||
Limit: screenWidth >= 1920 ? 12 : (screenWidth >= 1600 ? 8 : 6),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
CollapseBoxSetItems: false,
|
||||
|
@ -85,7 +85,7 @@
|
|||
|
||||
userId: Dashboard.getCurrentUserId(),
|
||||
categoryLimit: screenWidth >= 1200 ? 4 : 3,
|
||||
ItemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 7 : (screenWidth >= 1200 ? 7 : 7)),
|
||||
ItemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 7 : 6)),
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
|
|
|
@ -760,6 +760,10 @@ var Dashboard = {
|
|||
name: Globalize.translate('TabPlayback'),
|
||||
href: "playbackconfiguration.html",
|
||||
selected: page.hasClass('playbackConfigurationPage')
|
||||
}, {
|
||||
name: Globalize.translate('TabSync'),
|
||||
href: "syncactivity.html",
|
||||
selected: page.hasClass('syncConfigurationPage')
|
||||
}, {
|
||||
divider: true,
|
||||
name: Globalize.translate('TabAutoOrganize'),
|
||||
|
@ -1258,7 +1262,7 @@ var Dashboard = {
|
|||
PlayableMediaTypes: "Audio,Video",
|
||||
|
||||
SupportedCommands: Dashboard.getSupportedRemoteCommands().join(','),
|
||||
SupportsDeviceId: false
|
||||
SupportsUniqueIdentifier: false
|
||||
};
|
||||
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, appName, appVersion, deviceName, deviceId, capabilities);
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
(function (window, $) {
|
||||
|
||||
function submitJob(userId, items, form) {
|
||||
function submitJob(userId, syncOptions, form) {
|
||||
|
||||
if (!userId) {
|
||||
throw new Error('userId cannot be null');
|
||||
}
|
||||
|
||||
if (!syncOptions) {
|
||||
throw new Error('syncOptions cannot be null');
|
||||
}
|
||||
|
||||
if (!form) {
|
||||
throw new Error('form cannot be null');
|
||||
}
|
||||
|
||||
var target = $('.radioSync:checked', form).get().map(function (c) {
|
||||
|
||||
|
@ -10,7 +22,7 @@
|
|||
|
||||
if (!target) {
|
||||
|
||||
Dashboard.alert('Please select a device to sync to.');
|
||||
Dashboard.alert(Globalize.translate('MessagePleaseSelectDeviceToSyncTo'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -19,8 +31,8 @@
|
|||
userId: userId,
|
||||
TargetId: target,
|
||||
|
||||
ItemIds: items.map(function (i) {
|
||||
return i.Id;
|
||||
ItemIds: syncOptions.items.map(function (i) {
|
||||
return i.Id || i;
|
||||
}).join(','),
|
||||
|
||||
Quality: $('.radioSyncQuality', form)[0].getAttribute('data-value'),
|
||||
|
@ -39,10 +51,11 @@
|
|||
|
||||
$('.syncPanel').panel('close');
|
||||
$(window.SyncManager).trigger('jobsubmit');
|
||||
Dashboard.alert(Globalize.translate('MessageSyncJobCreated'));
|
||||
});
|
||||
}
|
||||
|
||||
function showSyncMenu(items) {
|
||||
function showSyncMenu(options) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
|
@ -59,17 +72,17 @@
|
|||
|
||||
html += '<form class="formSubmitSyncRequest">';
|
||||
|
||||
if (items.length > 1) {
|
||||
if (options.items.length > 1) {
|
||||
|
||||
html += '<p>';
|
||||
html += '<label for="txtSyncJobName">Sync job name:</label>';
|
||||
html += '<label for="txtSyncJobName">' + Globalize.translate('LabelSyncJobName') + '</label>';
|
||||
html += '<input type="text" id="txtSyncJobName" class="txtSyncJobName" required="required" />';
|
||||
html += '</p>';
|
||||
}
|
||||
|
||||
html += '<div>';
|
||||
html += '<fieldset data-role="controlgroup">';
|
||||
html += '<legend>Sync to:</legend>';
|
||||
html += '<legend>' + Globalize.translate('LabelSyncTo') + '</legend>';
|
||||
|
||||
var index = 0;
|
||||
|
||||
|
@ -92,19 +105,19 @@
|
|||
|
||||
html += '<div>';
|
||||
html += '<fieldset data-role="controlgroup">';
|
||||
html += '<legend>Quality:</legend>';
|
||||
html += '<label for="radioHighSyncQuality">High</label>';
|
||||
html += '<legend>' + Globalize.translate('LabelQuality') + '</legend>';
|
||||
html += '<label for="radioHighSyncQuality">' + Globalize.translate('OptionHigh') + '</label>';
|
||||
html += '<input type="radio" id="radioHighSyncQuality" name="radioSyncQuality" checked="checked" class="radioSyncQuality" data-value="High" />';
|
||||
html += '<label for="radioMediumSyncQuality">Medium</label>';
|
||||
html += '<label for="radioMediumSyncQuality">' + Globalize.translate('OptionMedium') + '</label>';
|
||||
html += '<input type="radio" id="radioMediumSyncQuality" name="radioSyncQuality" class="radioSyncQuality" data-value="Medium" />';
|
||||
html += '<label for="radioLowSyncQuality">Low</label>';
|
||||
html += '<label for="radioLowSyncQuality">' + Globalize.translate('OptionLow') + '</label>';
|
||||
html += '<input type="radio" id="radioLowSyncQuality" name="radioSyncQuality" class="radioSyncQuality" data-value="Low" />';
|
||||
html += '</fieldset>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<br/>';
|
||||
html += '<p>';
|
||||
html += '<button type="submit" data-icon="refresh" data-theme="b">Sync</button>';
|
||||
html += '<button type="submit" data-icon="refresh" data-theme="b">' + Globalize.translate('ButtonSync') + '</button>';
|
||||
html += '</p>';
|
||||
|
||||
html += '</form>';
|
||||
|
@ -119,7 +132,7 @@
|
|||
|
||||
$('form', elem).on('submit', function () {
|
||||
|
||||
submitJob(userId, items, this);
|
||||
submitJob(userId, options, this);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
width: 400,
|
||||
tag: job.PrimaryImageTag
|
||||
});
|
||||
style = "background-position:center center;";
|
||||
} else {
|
||||
style = "background-color:#38c;background-position:center center;";
|
||||
imgUrl = "css/images/items/detail/video.png";
|
||||
|
@ -80,16 +81,8 @@
|
|||
if (job.Status == 'Completed') {
|
||||
html += '<div class="playedIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
|
||||
}
|
||||
else if (job.Status == 'Queued') {
|
||||
}
|
||||
else if (job.Status == 'Transcoding' || job.Status == 'Transferring') {
|
||||
html += '<div class="playedIndicator"><div class="ui-icon-refresh ui-btn-icon-notext"></div></div>';
|
||||
}
|
||||
else if (job.Status == 'Cancelled') {
|
||||
html += '<div class="playedIndicator" style="background-color:#FF6A00;"><div class="ui-icon-minus ui-btn-icon-notext"></div></div>';
|
||||
}
|
||||
else if (job.Status == 'TranscodingFailed') {
|
||||
html += '<div class="playedIndicator" style="background-color:#cc0000;"><div class="ui-icon-alert ui-btn-icon-notext"></div></div>';
|
||||
else if (job.Status == 'CompletedWithError') {
|
||||
html += '<div class="playedIndicator" style="background-color:#cc0000;"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
|
||||
}
|
||||
|
||||
// cardContent
|
||||
|
@ -215,13 +208,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dashboardSyncPage", function () {
|
||||
$(document).on('pageshow', "#syncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reloadData(page);
|
||||
|
||||
}).on('pageinit', "#dashboardSyncPage", function () {
|
||||
}).on('pageinit', "#syncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
1
dashboard-ui/scripts/syncsettings.js
Normal file
1
dashboard-ui/scripts/syncsettings.js
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
$(document).on('pagebeforeshow', "#tvNextUpPage", function () {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
@ -30,7 +29,7 @@
|
|||
showParentTitle: false,
|
||||
showUnplayedIndicator: false,
|
||||
showChildCountIndicator: true,
|
||||
overlayText: screenWidth >= 600,
|
||||
overlayText: true,
|
||||
lazy: true
|
||||
|
||||
})).trigger('create').createCardMenus();
|
||||
|
|
|
@ -89,8 +89,6 @@
|
|||
|
||||
function loadResume(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var options = {
|
||||
|
@ -99,7 +97,7 @@
|
|||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1200 ? 6 : 4),
|
||||
Limit: 6,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData,SyncInfo",
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'List');
|
||||
var view = LibraryBrowser.getDefaultItemsView('Thumb', 'Thumb');
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
|
24
dashboard-ui/syncactivity.html
Normal file
24
dashboard-ui/syncactivity.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleSync}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="syncActivityPage" data-role="page" class="page type-interior syncConfigurationPage">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabActivity}</a>
|
||||
<a href="syncsettings.html" data-role="button">${TabSettings}</a>
|
||||
</div>
|
||||
|
||||
<div class="syncActivity">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
dashboard-ui/syncsettings.html
Normal file
24
dashboard-ui/syncsettings.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleSync}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="syncSettingsPage" data-role="page" class="page type-interior syncConfigurationPage">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="syncactivity.html" data-role="button">${TabActivity}</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">${TabSettings}</a>
|
||||
</div>
|
||||
|
||||
<div class="syncActivity">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1104,6 +1104,17 @@
|
|||
});
|
||||
};
|
||||
|
||||
self.getInstantMixFromPlaylist = function (itemId, options) {
|
||||
|
||||
var url = self.getUrl("Playlists/" + itemId + "/InstantMix", options);
|
||||
|
||||
return self.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json"
|
||||
});
|
||||
};
|
||||
|
||||
self.getEpisodes = function (itemId, options) {
|
||||
|
||||
var url = self.getUrl("Shows/" + itemId + "/Episodes", options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue