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 {
|
.channelPrograms {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
height: 53px;
|
height: 56px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeslotHeader {
|
.timeslotHeader {
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.channelHeaderCellInner {
|
.channelHeaderCellInner {
|
||||||
padding: .5em .5em;
|
padding: .7em .5em .5em;
|
||||||
display: block;
|
display: block;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
|
@ -251,11 +251,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.channelHeaderCell, .timeslotCell {
|
.channelHeaderCell, .timeslotCell {
|
||||||
height: 52px;
|
height: 55px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guideProgramName {
|
.guideProgramName {
|
||||||
padding: .35em .5em;
|
padding: .55em .5em .35em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guideProgramTime {
|
.guideProgramTime {
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
<span id="playButtonContainer" style="display: none;">
|
<span id="playButtonContainer" style="display: none;">
|
||||||
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true">${ButtonPlay}</button>
|
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true">${ButtonPlay}</button>
|
||||||
</span>
|
</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;">
|
<span id="deleteButtonContainer" style="display: none;">
|
||||||
<button id="btnDelete" type="button" data-icon="delete" data-inline="true" data-mini="true">${ButtonDelete}</button>
|
<button id="btnDelete" type="button" data-icon="delete" data-inline="true" data-mini="true">${ButtonDelete}</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -21,7 +21,10 @@
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
<div id="latestRecordings" style="display: none;">
|
<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>
|
<div class="recordingItems itemsContainer"></div>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -78,6 +78,15 @@
|
||||||
LiveTvHelpers.renderOriginalAirDate($('.airDate', page), item);
|
LiveTvHelpers.renderOriginalAirDate($('.airDate', page), item);
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
|
|
||||||
|
Dashboard.getCurrentUser().done(function(user) {
|
||||||
|
|
||||||
|
if (SyncManager.isAvailable(item, user)) {
|
||||||
|
$('.btnSync', page).removeClass('hide');
|
||||||
|
} else {
|
||||||
|
$('.btnSync', page).addClass('hide');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload(page) {
|
function reload(page) {
|
||||||
|
@ -100,6 +109,13 @@
|
||||||
$('#btnDelete', page).on('click', deleteRecording);
|
$('#btnDelete', page).on('click', deleteRecording);
|
||||||
$('#btnPlay', page).on('click', play);
|
$('#btnPlay', page).on('click', play);
|
||||||
|
|
||||||
|
$('.btnSync', page).on('click', function () {
|
||||||
|
|
||||||
|
SyncManager.showMenu({
|
||||||
|
items: [currentItem]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#liveTvRecordingPage", function () {
|
}).on('pagebeforeshow', "#liveTvRecordingPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
(function ($, document) {
|
(function ($, document) {
|
||||||
|
|
||||||
|
function itemsPerRow() {
|
||||||
|
|
||||||
|
var screenWidth = $(window).width();
|
||||||
|
|
||||||
|
return screenWidth >= 2200 ? 10 : 9;
|
||||||
|
}
|
||||||
|
|
||||||
function loadLatest(page, parentId) {
|
function loadLatest(page, parentId) {
|
||||||
|
|
||||||
var userId = Dashboard.getCurrentUserId();
|
var userId = Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
IncludeItemTypes: "Audio",
|
IncludeItemTypes: "Audio",
|
||||||
Limit: 9,
|
Limit: itemsPerRow(),
|
||||||
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
||||||
ParentId: parentId,
|
ParentId: parentId,
|
||||||
ImageTypeLimit: 1,
|
ImageTypeLimit: 1,
|
||||||
|
@ -37,7 +44,7 @@
|
||||||
SortBy: "DatePlayed",
|
SortBy: "DatePlayed",
|
||||||
SortOrder: "Descending",
|
SortOrder: "Descending",
|
||||||
IncludeItemTypes: "Audio",
|
IncludeItemTypes: "Audio",
|
||||||
Limit: 9,
|
Limit: itemsPerRow(),
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
||||||
Filters: "IsPlayed",
|
Filters: "IsPlayed",
|
||||||
|
@ -77,7 +84,7 @@
|
||||||
SortBy: "PlayCount",
|
SortBy: "PlayCount",
|
||||||
SortOrder: "Descending",
|
SortOrder: "Descending",
|
||||||
IncludeItemTypes: "Audio",
|
IncludeItemTypes: "Audio",
|
||||||
Limit: 9,
|
Limit: itemsPerRow(),
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
Fields: "PrimaryImageAspectRatio,AudioInfo,SyncInfo",
|
||||||
Filters: "IsPlayed",
|
Filters: "IsPlayed",
|
||||||
|
@ -121,7 +128,7 @@
|
||||||
ParentId: parentId,
|
ParentId: parentId,
|
||||||
Fields: "PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks,CanDelete,SyncInfo",
|
Fields: "PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks,CanDelete,SyncInfo",
|
||||||
StartIndex: 0,
|
StartIndex: 0,
|
||||||
Limit: 9
|
Limit: itemsPerRow()
|
||||||
};
|
};
|
||||||
|
|
||||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||||
|
@ -139,6 +146,7 @@
|
||||||
shape: "square",
|
shape: "square",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
|
defaultAction: 'play',
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
showItemCounts: true,
|
showItemCounts: true,
|
||||||
cardLayout: true
|
cardLayout: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue