1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update display of active recordings

This commit is contained in:
Luke Pulverenti 2016-10-11 02:46:59 -04:00
parent f11a08df43
commit 8bf645c346
24 changed files with 224 additions and 185 deletions

View file

@ -36,7 +36,7 @@
lazy: true,
preferThumb: true,
showDetailsMenu: true,
centerText: true,
centerText: !supportsImageAnalysis,
overlayPlayButton: AppInfo.enableAppLayouts && !supportsImageAnalysis,
context: 'home-nextup',
cardLayout: supportsImageAnalysis,

View file

@ -118,7 +118,7 @@
preferThumb: true,
lazy: true,
showDetailsMenu: true,
centerText: true,
centerText: !supportsImageAnalysis,
context: 'home-upcoming',
overlayMoreButton: !supportsImageAnalysis,
showParentTitle: true,

View file

@ -1,4 +1,47 @@
define(['scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function () {
define(['cardBuilder', 'scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function (cardBuilder) {
function enableScrollX() {
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function renderRecordings(elem, recordings, cardOptions) {
if (recordings.length) {
elem.classList.remove('hide');
} else {
elem.classList.add('hide');
}
var recordingItems = elem.querySelector('.recordingItems');
if (enableScrollX()) {
recordingItems.classList.add('hiddenScrollX');
recordingItems.classList.remove('vertical-wrap');
} else {
recordingItems.classList.remove('hiddenScrollX');
recordingItems.classList.add('vertical-wrap');
}
recordingItems.innerHTML = cardBuilder.getCardsHtml(Object.assign({
items: recordings,
shape: (enableScrollX() ? 'autooverflow' : 'auto'),
showTitle: true,
showParentTitle: true,
coverImage: true,
lazy: true,
cardLayout: true,
vibrant: true,
allowBottomPadding: !enableScrollX(),
preferThumb: 'auto'
}, cardOptions || {}));
ImageLoader.lazyChildren(recordingItems);
}
function getBackdropShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function renderActiveRecordings(context, promise) {
@ -9,8 +52,18 @@
result.Items = [];
}
renderTimers(context.querySelector('#activeRecordings'), result.Items, {
indexByDate: false
renderRecordings(context.querySelector('#activeRecordings'), result.Items, {
shape: getBackdropShape(),
showParentTitle: false,
showTitle: true,
showAirTime: true,
showAirEndTime: true,
showChannelName: true,
cardLayout: true,
vibrant: true,
preferThumb: true,
coverImage: true,
overlayText: false
});
});
}
@ -54,8 +107,13 @@
});
self.preRender = function () {
activeRecordingsPromise = ApiClient.getLiveTvTimers({
IsActive: true
activeRecordingsPromise = ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
IsInProgress: true,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
EnableImageTypes: "Primary,Thumb,Backdrop"
});
upcomingRecordingsPromise = ApiClient.getLiveTvTimers({

View file

@ -4,6 +4,70 @@
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function renderRecordings(elem, recordings, cardOptions) {
if (recordings.length) {
elem.classList.remove('hide');
} else {
elem.classList.add('hide');
}
var recordingItems = elem.querySelector('.recordingItems');
if (enableScrollX()) {
recordingItems.classList.add('hiddenScrollX');
recordingItems.classList.remove('vertical-wrap');
} else {
recordingItems.classList.remove('hiddenScrollX');
recordingItems.classList.add('vertical-wrap');
}
recordingItems.innerHTML = cardBuilder.getCardsHtml(Object.assign({
items: recordings,
shape: (enableScrollX() ? 'autooverflow' : 'auto'),
showTitle: true,
showParentTitle: true,
coverImage: true,
lazy: true,
cardLayout: true,
vibrant: true,
allowBottomPadding: !enableScrollX(),
preferThumb: 'auto'
}, cardOptions || {}));
ImageLoader.lazyChildren(recordingItems);
}
function getBackdropShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function renderActiveRecordings(context, promise) {
promise.then(function (result) {
// The IsActive param is new, so handle older servers that don't support it
if (result.Items.length && result.Items[0].Status != 'InProgress') {
result.Items = [];
}
renderRecordings(context.querySelector('#activeRecordings'), result.Items, {
shape: getBackdropShape(),
showParentTitle: false,
showTitle: true,
showAirTime: true,
showAirEndTime: true,
showChannelName: true,
cardLayout: true,
vibrant: true,
preferThumb: true,
coverImage: true,
overlayText: false
});
});
}
function getPortraitShape() {
return enableScrollX() ? 'overflowPortrait' : 'portrait';
}
@ -43,6 +107,14 @@
loadRecommendedPrograms(page);
renderActiveRecordings(page, ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
IsInProgress: true,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
EnableImageTypes: "Primary,Thumb,Backdrop"
}));
ApiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
@ -122,7 +194,7 @@
shape: shape || (enableScrollX() ? 'overflowBackdrop' : 'backdrop'),
showParentTitleOrTitle: true,
showTitle: false,
centerText: true,
centerText: !supportsImageAnalysis,
coverImage: true,
overlayText: false,
lazy: true,
@ -134,7 +206,6 @@
showChannelName: true,
vibrant: true,
cardLayout: supportsImageAnalysis
//cardFooterAside: 'logo'
});
var elem = page.querySelector('.' + sectionClass);
@ -172,9 +243,6 @@
var tabControllers = [];
var renderedTabs = [];
var tabControllers = [];
var renderedTabs = [];
function getTabController(page, index, callback) {
var depends = [];
@ -247,7 +315,7 @@
if (renderedTabs.indexOf(index) == -1) {
if (index < 2) {
if (index === 1) {
renderedTabs.push(index);
}
controller.renderTab();

View file

@ -78,7 +78,7 @@
showTitle: true,
scalable: true,
showItemCounts: true,
centerText: true,
centerText: false,
cardLayout: true
});
}
@ -89,7 +89,7 @@
showTitle: true,
scalable: true,
showItemCounts: true,
centerText: true,
centerText: false,
cardLayout: true
});
}

View file

@ -45,7 +45,7 @@
showTitle: true,
showParentTitle: true,
lazy: true,
centerText: true,
centerText: !supportsImageAnalysis,
overlayPlayButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
@ -97,7 +97,7 @@
showParentTitle: true,
action: 'instantmix',
lazy: true,
centerText: true,
centerText: !supportsImageAnalysis,
overlayMoreButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
@ -149,7 +149,7 @@
showParentTitle: true,
action: 'instantmix',
lazy: true,
centerText: true,
centerText: !supportsImageAnalysis,
overlayMoreButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
@ -197,7 +197,7 @@
lazy: true,
coverImage: true,
showItemCounts: true,
centerText: true,
centerText: !supportsImageAnalysis,
overlayPlayButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,

View file

@ -572,8 +572,7 @@
centerText: true,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
cardFooterAside: 'none'
vibrant: supportsImageAnalysis
});
html += '</div>';
}
@ -662,7 +661,7 @@
});
}
function loadLatestLiveTvRecordings(elem, userId, index) {
function loadLatestLiveTvRecordings(elem, userId) {
return ApiClient.getLiveTvRecordings({
@ -678,10 +677,8 @@
if (result.Items.length) {
var cssClass = index !== 0 ? 'listHeader' : 'listHeader';
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderLatestTvRecordings') + '</h1>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate('HeaderLatestTvRecordings') + '</h1>';
html += '<a href="livetv.html?tab=3" onclick="LibraryBrowser.showTab(\'livetv.html\',3);" class="clearLink" style="margin-left:2em;"><button is="emby-button" type="button" class="raised more mini"><span>' + Globalize.translate('ButtonMore') + '</span></button></a>';
html += '</div>';
}
@ -708,8 +705,7 @@
allowBottomPadding: !enableScrollX(),
preferThumb: true,
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
cardFooterAside: 'none'
vibrant: supportsImageAnalysis
});
html += '</div>';

View file

@ -78,7 +78,7 @@
showTitle: true,
scalable: true,
showItemCounts: true,
centerText: true,
centerText: false,
cardLayout: true
});
}
@ -89,7 +89,7 @@
showTitle: true,
scalable: true,
showItemCounts: true,
centerText: true,
centerText: false,
cardLayout: true
});
}

View file

@ -45,11 +45,10 @@
showTitle: true,
showParentTitle: true,
overlayText: false,
centerText: true,
centerText: !supportsImageAnalysis,
overlayPlayButton: true,
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
cardFooterAside: 'none'
vibrant: supportsImageAnalysis
});
Dashboard.hideLoadingMsg();
@ -107,9 +106,10 @@
showTitle: true,
showParentTitle: true,
overlayText: false,
centerText: true,
centerText: false,
overlayPlayButton: true,
allowBottomPadding: allowBottomPadding
allowBottomPadding: allowBottomPadding,
cardLayout: true
});
});
}

View file

@ -120,7 +120,7 @@
preferThumb: true,
lazy: true,
showDetailsMenu: true,
centerText: true,
centerText: !supportsImageAnalysis,
showParentTitle: true,
allowBottomPadding: allowBottomPadding,
cardLayout: supportsImageAnalysis,