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
|
@ -158,7 +158,7 @@
|
|||
|
||||
.channelPrograms {
|
||||
white-space: nowrap;
|
||||
height: 53px;
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.timeslotHeader {
|
||||
|
@ -201,7 +201,7 @@
|
|||
}
|
||||
|
||||
.channelHeaderCellInner {
|
||||
padding: .5em .5em;
|
||||
padding: .7em .5em .5em;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
font-weight: normal !important;
|
||||
|
@ -251,11 +251,11 @@
|
|||
}
|
||||
|
||||
.channelHeaderCell, .timeslotCell {
|
||||
height: 52px;
|
||||
height: 55px;
|
||||
}
|
||||
|
||||
.guideProgramName {
|
||||
padding: .35em .5em;
|
||||
padding: .55em .5em .35em;
|
||||
}
|
||||
|
||||
.guideProgramTime {
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
<span id="playButtonContainer" style="display: none;">
|
||||
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true">${ButtonPlay}</button>
|
||||
</span>
|
||||
<a class="btnSync hide" data-role="button" data-icon="cloud" data-inline="true" data-mini="true" href="#">${ButtonSync}</a>
|
||||
<span id="deleteButtonContainer" style="display: none;">
|
||||
<button id="btnDelete" type="button" data-icon="delete" data-inline="true" data-mini="true">${ButtonDelete}</button>
|
||||
</span>
|
||||
|
|
|
@ -21,7 +21,10 @@
|
|||
<br />
|
||||
</div>
|
||||
<div id="latestRecordings" style="display: none;">
|
||||
<h1 class="listHeader">${HeaderLatestRecordings}</h1>
|
||||
<div>
|
||||
<h1 class="listHeader" style="display:inline-block;vertical-align:middle;">${HeaderLatestRecordings}</h1>
|
||||
<a href="#" class="accentButton categorySyncButton" data-category="Latest"><i class="fa fa-cloud"></i>${ButtonSync}</a>
|
||||
</div>
|
||||
<div class="recordingItems itemsContainer"></div>
|
||||
<br />
|
||||
</div>
|
||||
|
|
|
@ -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