mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
rework server sync
This commit is contained in:
parent
4b3ce4d2ae
commit
24ea83ad5f
5 changed files with 37 additions and 9 deletions
|
@ -78,6 +78,15 @@
|
|||
LiveTvHelpers.renderOriginalAirDate($('.airDate', page), item);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
Dashboard.getCurrentUser().done(function(user) {
|
||||
|
||||
if (SyncManager.isAvailable(item, user)) {
|
||||
$('.btnSync', page).removeClass('hide');
|
||||
} else {
|
||||
$('.btnSync', page).addClass('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
@ -100,6 +109,13 @@
|
|||
$('#btnDelete', page).on('click', deleteRecording);
|
||||
$('#btnPlay', page).on('click', play);
|
||||
|
||||
$('.btnSync', page).on('click', function () {
|
||||
|
||||
SyncManager.showMenu({
|
||||
items: [currentItem]
|
||||
});
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow', "#liveTvRecordingPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
(function ($, document) {
|
||||
|
||||
function itemsPerRow() {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
return screenWidth >= 2200 ? 10 : 9;
|
||||
}
|
||||
|
||||
function loadLatest(page, parentId) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var options = {
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: 9,
|
||||
Limit: itemsPerRow(),
|
||||
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
|
@ -37,7 +44,7 @@
|
|||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: 9,
|
||||
Limit: itemsPerRow(),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
||||
Filters: "IsPlayed",
|
||||
|
@ -77,7 +84,7 @@
|
|||
SortBy: "PlayCount",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Audio",
|
||||
Limit: 9,
|
||||
Limit: itemsPerRow(),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
||||
Filters: "IsPlayed",
|
||||
|
@ -121,7 +128,7 @@
|
|||
ParentId: parentId,
|
||||
Fields: "PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks,CanDelete,SyncInfo",
|
||||
StartIndex: 0,
|
||||
Limit: 9
|
||||
Limit: itemsPerRow()
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
@ -139,6 +146,7 @@
|
|||
shape: "square",
|
||||
showTitle: true,
|
||||
lazy: true,
|
||||
defaultAction: 'play',
|
||||
coverImage: true,
|
||||
showItemCounts: true,
|
||||
cardLayout: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue