mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
commit
1450e24862
5 changed files with 9 additions and 42 deletions
|
@ -222,46 +222,13 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeImageOptions(options) {
|
function normalizeImageOptions(options) {
|
||||||
var scaleFactor = browser.tv ? 0.8 : 1;
|
|
||||||
|
|
||||||
var setQuality;
|
var setQuality;
|
||||||
if (options.maxWidth) {
|
if (options.maxWidth || options.width || options.maxHeight || options.height) {
|
||||||
options.maxWidth = Math.round(options.maxWidth * scaleFactor);
|
|
||||||
setQuality = true;
|
setQuality = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.width) {
|
if (setQuality && !options.quality) {
|
||||||
options.width = Math.round(options.width * scaleFactor);
|
options.quality = 90;
|
||||||
setQuality = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.maxHeight) {
|
|
||||||
options.maxHeight = Math.round(options.maxHeight * scaleFactor);
|
|
||||||
setQuality = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.height) {
|
|
||||||
options.height = Math.round(options.height * scaleFactor);
|
|
||||||
setQuality = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setQuality) {
|
|
||||||
var quality;
|
|
||||||
var type = options.type || 'Primary';
|
|
||||||
|
|
||||||
if (browser.tv || browser.slow) {
|
|
||||||
// TODO: wtf
|
|
||||||
if (browser.chrome) {
|
|
||||||
// webp support
|
|
||||||
quality = type === 'Primary' ? 40 : 50;
|
|
||||||
} else {
|
|
||||||
quality = type === 'Backdrop' ? 60 : 50;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
quality = type === 'Backdrop' ? 70 : 90;
|
|
||||||
}
|
|
||||||
|
|
||||||
options.quality = quality;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
|
||||||
imageClass += ' itemAction';
|
imageClass += ' itemAction';
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageAction = playOnImageClick ? 'resume' : action;
|
var imageAction = playOnImageClick ? 'link' : action;
|
||||||
|
|
||||||
if (imgUrl) {
|
if (imgUrl) {
|
||||||
html += '<div data-action="' + imageAction + '" class="' + imageClass + ' lazy" data-src="' + imgUrl + '" item-icon>';
|
html += '<div data-action="' + imageAction + '" class="' + imageClass + ' lazy" data-src="' + imgUrl + '" item-icon>';
|
||||||
|
|
|
@ -494,7 +494,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
itemsContainer.innerHTML = html;
|
itemsContainer.innerHTML = html;
|
||||||
if (focusedItemPlaylistId !== null) {
|
if (focusedItemPlaylistId !== null) {
|
||||||
focusedItemPlaylistId = focusedItemPlaylistId.getAttribute('data-playlistitemid');
|
focusedItemPlaylistId = focusedItemPlaylistId.getAttribute('data-playlistitemid');
|
||||||
const newFocusedItem = itemsContainer.querySelector(`button[data-playlistitemid=${focusedItemPlaylistId}]`);
|
const newFocusedItem = itemsContainer.querySelector(`button[data-playlistitemid="${focusedItemPlaylistId}"]`);
|
||||||
if (newFocusedItem !== null) {
|
if (newFocusedItem !== null) {
|
||||||
newFocusedItem.focus();
|
newFocusedItem.focus();
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
var playlistItemId = playbackManager.getCurrentPlaylistItemId(player);
|
var playlistItemId = playbackManager.getCurrentPlaylistItemId(player);
|
||||||
|
|
||||||
if (playlistItemId) {
|
if (playlistItemId) {
|
||||||
var img = itemsContainer.querySelector('.listItem[data-playlistItemId="' + playlistItemId + '"] .listItemImage');
|
var img = itemsContainer.querySelector(`.listItem[data-playlistItemId="${playlistItemId}"] .listItemImage`);
|
||||||
|
|
||||||
if (img) {
|
if (img) {
|
||||||
img.classList.remove('lazy');
|
img.classList.remove('lazy');
|
||||||
|
|
|
@ -464,7 +464,7 @@ define(['layoutManager', 'globalize', 'require', 'events', 'connectionManager',
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
overlayText: false,
|
overlayText: false,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
action: 'play'
|
overlayPlayButton: true
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -726,7 +726,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
|
||||||
disableIndicators: true,
|
disableIndicators: true,
|
||||||
disableHoverMenu: true,
|
disableHoverMenu: true,
|
||||||
overlayPlayButton: true,
|
overlayPlayButton: true,
|
||||||
width: dom.getWindowSize().innerWidth * 0.25
|
width: dom.getWindowSize().innerWidth * 0.5
|
||||||
});
|
});
|
||||||
|
|
||||||
elem.innerHTML = cardHtml;
|
elem.innerHTML = cardHtml;
|
||||||
|
@ -1361,7 +1361,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
|
||||||
imageSize: 'large',
|
imageSize: 'large',
|
||||||
enableSideMediaInfo: false,
|
enableSideMediaInfo: false,
|
||||||
highlight: false,
|
highlight: false,
|
||||||
action: layoutManager.tv ? 'resume' : 'none',
|
action: !layoutManager.desktop ? 'link' : 'none',
|
||||||
imagePlayButton: true,
|
imagePlayButton: true,
|
||||||
includeParentInfoInTitle: false
|
includeParentInfoInTitle: false
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue