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

limit number of people in dlna responses

This commit is contained in:
Luke Pulverenti 2016-10-18 14:23:41 -04:00
parent 11615f4399
commit 46d25396c6
8 changed files with 191 additions and 53 deletions

View file

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.320", "version": "1.4.321",
"_release": "1.4.320", "_release": "1.4.321",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.320", "tag": "1.4.321",
"commit": "5b3dc54cf24d4f615a59e5954726231e446cfced" "commit": "fb270e69c8391f62e762ee03d77a7b8a495c5a6f"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View file

@ -51,15 +51,21 @@
return; return;
} }
setTimeout(function () { var onAnimationComplete = function () {
dom.removeEventListener(backdropImage, 'animationend', onAnimationComplete, {
once: true
});
if (backdropImage === currentAnimatingElement) { if (backdropImage === currentAnimatingElement) {
currentAnimatingElement = null; currentAnimatingElement = null;
} }
if (existingBackdropImage && existingBackdropImage.parentNode) { if (existingBackdropImage && existingBackdropImage.parentNode) {
existingBackdropImage.parentNode.removeChild(existingBackdropImage); existingBackdropImage.parentNode.removeChild(existingBackdropImage);
} }
}, 800); };
dom.addEventListener(backdropImage, 'animationend', onAnimationComplete, {
once: true
});
internalBackdrop(true); internalBackdrop(true);
}; };

View file

@ -3,6 +3,24 @@
var globalOnOpenCallback; var globalOnOpenCallback;
function enableAnimation() {
if (browser.animate) {
return true;
}
if (browser.edge) {
return true;
}
// An indication of an older browser
if (browser.noFlex) {
return false;
}
return true;
}
function removeCenterFocus(dlg) { function removeCenterFocus(dlg) {
if (layoutManager.tv) { if (layoutManager.tv) {
@ -136,10 +154,9 @@
backdropParent.parentNode.insertBefore(backdrop, backdropParent); backdropParent.parentNode.insertBefore(backdrop, backdropParent);
dlg.backdrop = backdrop; dlg.backdrop = backdrop;
// Doing this immediately causes the opacity to jump immediately without animating // trigger reflow or the backdrop will not animate
setTimeout(function () { void backdrop.offsetWidth;
backdrop.classList.add('dialogBackdropOpened'); backdrop.classList.add('dialogBackdropOpened');
}, 0);
dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) { dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) {
if (e.target === dlg.dialogContainer) { if (e.target === dlg.dialogContainer) {
@ -226,27 +243,59 @@
} }
}; };
setTimeout(onAnimationFinish, dlg.animationConfig.entry.timing.duration); if (enableAnimation()) {
var onFinish = function () {
dom.removeEventListener(dlg, 'animationend', onFinish, {
once: true
});
onAnimationFinish();
};
dom.addEventListener(dlg, 'animationend', onFinish, {
once: true
});
return;
}
onAnimationFinish();
} }
function animateDialogClose(dlg, onAnimationFinish) { function animateDialogClose(dlg, onAnimationFinish) {
switch (dlg.animationConfig.exit.name) { if (enableAnimation()) {
case 'fadeout': var animated = true;
dlg.style.animation = 'fadeout ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both'; switch (dlg.animationConfig.exit.name) {
break;
case 'scaledown': case 'fadeout':
dlg.style.animation = 'scaledown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both'; dlg.style.animation = 'fadeout ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break; break;
case 'slidedown': case 'scaledown':
dlg.style.animation = 'slidedown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both'; dlg.style.animation = 'scaledown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break; break;
default: case 'slidedown':
break; dlg.style.animation = 'slidedown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
default:
animated = false;
break;
}
var onFinish = function () {
dom.removeEventListener(dlg, 'animationend', onFinish, {
once: true
});
onAnimationFinish();
};
dom.addEventListener(dlg, 'animationend', onFinish, {
once: true
});
if (animated) {
return;
}
} }
setTimeout(onAnimationFinish, dlg.animationConfig.exit.timing.duration); onAnimationFinish();
} }
function shouldLockDocumentScroll(options) { function shouldLockDocumentScroll(options) {
@ -270,15 +319,26 @@
var backdrop = dlg.backdrop; var backdrop = dlg.backdrop;
if (backdrop) { if (!backdrop) {
dlg.backdrop = null; return;
}
dlg.backdrop = null;
var onAnimationFinish = function () {
backdrop.parentNode.removeChild(backdrop);
};
if (enableAnimation()) {
backdrop.classList.remove('dialogBackdropOpened'); backdrop.classList.remove('dialogBackdropOpened');
setTimeout(function () { // this is not firing animatonend
backdrop.parentNode.removeChild(backdrop); setTimeout(onAnimationFinish, 300);
}, 300); return;
} }
onAnimationFinish();
} }
function centerFocus(elem, horiz, on) { function centerFocus(elem, horiz, on) {
@ -375,19 +435,21 @@
dlg.classList.add('dialog-' + options.size); dlg.classList.add('dialog-' + options.size);
} }
switch (dlg.animationConfig.entry.name) { if (enableAnimation()) {
switch (dlg.animationConfig.entry.name) {
case 'fadein': case 'fadein':
dlg.style.animation = 'fadein ' + entryAnimationDuration + 'ms ease-out normal'; dlg.style.animation = 'fadein ' + entryAnimationDuration + 'ms ease-out normal';
break; break;
case 'scaleup': case 'scaleup':
dlg.style.animation = 'scaleup ' + entryAnimationDuration + 'ms ease-out normal both'; dlg.style.animation = 'scaleup ' + entryAnimationDuration + 'ms ease-out normal both';
break; break;
case 'slideup': case 'slideup':
dlg.style.animation = 'slideup ' + entryAnimationDuration + 'ms ease-out normal'; dlg.style.animation = 'slideup ' + entryAnimationDuration + 'ms ease-out normal';
break; break;
default: default:
break; break;
}
} }
return dlg; return dlg;

View file

@ -151,7 +151,7 @@
console.log('validateFeature: ' + feature); console.log('validateFeature: ' + feature);
return iapManager.isUnlockedByDefault(feature).then(function () { return iapManager.isUnlockedByDefault(feature, options).then(function () {
return showPeriodicMessageIfNeeded(feature); return showPeriodicMessageIfNeeded(feature);

View file

@ -1,4 +1,4 @@
define(['browser', 'css!./viewcontainer-lite'], function (browser) { define(['browser', 'dom', 'css!./viewcontainer-lite'], function (browser, dom) {
'use strict'; 'use strict';
var mainAnimatedPages = document.querySelector('.mainAnimatedPages'); var mainAnimatedPages = document.querySelector('.mainAnimatedPages');
@ -140,7 +140,16 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
currentAnimations = animations; currentAnimations = animations;
setTimeout(resolve, duration); var onAnimationComplete = function () {
dom.removeEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
resolve();
};
dom.addEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
}); });
} }
@ -161,7 +170,16 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
currentAnimations = animations; currentAnimations = animations;
setTimeout(resolve, duration); var onAnimationComplete = function () {
dom.removeEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
resolve();
};
dom.addEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
}); });
} }

View file

@ -107,6 +107,12 @@
<div id="castContent" is="emby-itemscontainer" class="itemsContainer"></div> <div id="castContent" is="emby-itemscontainer" class="itemsContainer"></div>
<button is="emby-button" type="button" class="raised more morePeople hide">${ButtonMore}</button> <button is="emby-button" type="button" class="raised more morePeople hide">${ButtonMore}</button>
</div> </div>
<div id="seriesScheduleSection" class="detailSection hide">
<h1>
${HeaderUpcomingOnTV}
</h1>
<div id="seriesScheduleList" is="emby-itemscontainer" class="itemsContainer vertical-list"></div>
</div>
<div class="detailSection photoInfo hide"> <div class="detailSection photoInfo hide">
<h1> <h1>

View file

@ -446,6 +446,11 @@
page.querySelector('#childrenCollapsible').classList.add('hide'); page.querySelector('#childrenCollapsible').classList.add('hide');
} }
if (item.Type == 'Series') {
renderSeriesSchedule(page, item, user);
}
if (item.Type == 'Series') { if (item.Type == 'Series') {
renderNextUp(page, item, user); renderNextUp(page, item, user);
@ -934,20 +939,21 @@
} }
var supportsImageAnalysis = appHost.supports('imageanalysis'); var supportsImageAnalysis = appHost.supports('imageanalysis');
var cardLayout = supportsImageAnalysis && (item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist");
html += cardBuilder.getCardsHtml({ html += cardBuilder.getCardsHtml({
items: result.Items, items: result.Items,
shape: shape, shape: shape,
showParentTitle: item.Type == "MusicAlbum", showParentTitle: item.Type == "MusicAlbum",
centerText: !supportsImageAnalysis, centerText: !cardLayout,
showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist", showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist",
context: context, context: context,
lazy: true, lazy: true,
showDetailsMenu: true, showDetailsMenu: true,
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist", coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist",
overlayPlayButton: true, overlayPlayButton: true,
cardLayout: supportsImageAnalysis && (item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist"), cardLayout: cardLayout,
vibrant: supportsImageAnalysis vibrant: cardLayout && supportsImageAnalysis
}); });
html += '</div>'; html += '</div>';
@ -1242,10 +1248,49 @@
function renderChannelGuide(page, item, user) { function renderChannelGuide(page, item, user) {
require('scripts/livetvcomponents,scripts/livetvchannel,livetvcss'.split(','), function () { require('scripts/livetvchannel,scripts/livetvcomponents,livetvcss'.split(','), function (liveTvChannelPage) {
liveTvChannelPage.renderPrograms(page, item.Id);
});
}
LiveTvChannelPage.renderPrograms(page, item.Id); function renderSeriesSchedule(page, item, user) {
return;
ApiClient.getLiveTvPrograms({
UserId: Dashboard.getCurrentUserId(),
HasAired: false,
SortBy: "StartDate",
EnableTotalRecordCount: false,
EnableImages: false,
ImageTypeLimit: 0,
Limit: 50,
EnableUserData: false,
LibrarySeriesId: item.Id
}).then(function (result) {
if (result.Items.length) {
page.querySelector('#seriesScheduleSection').classList.remove('hide');
} else {
page.querySelector('#seriesScheduleSection').classList.add('hide');
}
page.querySelector('#seriesScheduleList').innerHTML = listView.getListViewHtml({
items: result.Items,
enableUserDataButtons: false,
showParentTitle: false,
image: false,
showProgramDateTime: true,
mediaInfo: false,
showTitle: true,
moreButton: false,
action: 'programdialog'
});
Dashboard.hideLoadingMsg();
}); });
} }

View file

@ -55,7 +55,8 @@
SortBy: "StartDate", SortBy: "StartDate",
EnableTotalRecordCount: false, EnableTotalRecordCount: false,
EnableImages: false, EnableImages: false,
ImageTypeLimit: 0 ImageTypeLimit: 0,
EnableUserData: false
}).then(function (result) { }).then(function (result) {
@ -64,7 +65,7 @@
}); });
} }
window.LiveTvChannelPage = { return {
renderPrograms: loadPrograms renderPrograms: loadPrograms
}; };