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) {
|
||||
var scaleFactor = browser.tv ? 0.8 : 1;
|
||||
|
||||
var setQuality;
|
||||
if (options.maxWidth) {
|
||||
options.maxWidth = Math.round(options.maxWidth * scaleFactor);
|
||||
if (options.maxWidth || options.width || options.maxHeight || options.height) {
|
||||
setQuality = true;
|
||||
}
|
||||
|
||||
if (options.width) {
|
||||
options.width = Math.round(options.width * scaleFactor);
|
||||
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;
|
||||
if (setQuality && !options.quality) {
|
||||
options.quality = 90;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
|
|||
imageClass += ' itemAction';
|
||||
}
|
||||
|
||||
var imageAction = playOnImageClick ? 'resume' : action;
|
||||
var imageAction = playOnImageClick ? 'link' : action;
|
||||
|
||||
if (imgUrl) {
|
||||
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;
|
||||
if (focusedItemPlaylistId !== null) {
|
||||
focusedItemPlaylistId = focusedItemPlaylistId.getAttribute('data-playlistitemid');
|
||||
const newFocusedItem = itemsContainer.querySelector(`button[data-playlistitemid=${focusedItemPlaylistId}]`);
|
||||
const newFocusedItem = itemsContainer.querySelector(`button[data-playlistitemid="${focusedItemPlaylistId}"]`);
|
||||
if (newFocusedItem !== null) {
|
||||
newFocusedItem.focus();
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
|||
var playlistItemId = playbackManager.getCurrentPlaylistItemId(player);
|
||||
|
||||
if (playlistItemId) {
|
||||
var img = itemsContainer.querySelector('.listItem[data-playlistItemId="' + playlistItemId + '"] .listItemImage');
|
||||
var img = itemsContainer.querySelector(`.listItem[data-playlistItemId="${playlistItemId}"] .listItemImage`);
|
||||
|
||||
if (img) {
|
||||
img.classList.remove('lazy');
|
||||
|
|
|
@ -464,7 +464,7 @@ define(['layoutManager', 'globalize', 'require', 'events', 'connectionManager',
|
|||
showTitle: true,
|
||||
overlayText: false,
|
||||
centerText: true,
|
||||
action: 'play'
|
||||
overlayPlayButton: true
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -726,7 +726,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
|
|||
disableIndicators: true,
|
||||
disableHoverMenu: true,
|
||||
overlayPlayButton: true,
|
||||
width: dom.getWindowSize().innerWidth * 0.25
|
||||
width: dom.getWindowSize().innerWidth * 0.5
|
||||
});
|
||||
|
||||
elem.innerHTML = cardHtml;
|
||||
|
@ -1361,7 +1361,7 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
|
|||
imageSize: 'large',
|
||||
enableSideMediaInfo: false,
|
||||
highlight: false,
|
||||
action: layoutManager.tv ? 'resume' : 'none',
|
||||
action: !layoutManager.desktop ? 'link' : 'none',
|
||||
imagePlayButton: true,
|
||||
includeParentInfoInTitle: false
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue