mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Simplify code with object shorthand syntax
This commit is contained in:
parent
a3c330b4e1
commit
cf5d65d86e
5 changed files with 23 additions and 28 deletions
|
@ -1261,7 +1261,7 @@ import { appRouter } from '../appRouter';
|
|||
logoUrl = null;
|
||||
|
||||
footerCssClass = progressHtml ? 'innerCardFooter fullInnerCardFooter' : 'innerCardFooter';
|
||||
innerCardFooter += getCardFooterText(item, apiClient, options, footerCssClass, progressHtml, {forceName: forceName, overlayText: overlayText, isOuterFooter: false}, {imgUrl: imgUrl, logoUrl: logoUrl});
|
||||
innerCardFooter += getCardFooterText(item, apiClient, options, footerCssClass, progressHtml, { forceName, overlayText, isOuterFooter: false }, { imgUrl, logoUrl });
|
||||
footerOverlayed = true;
|
||||
} else if (progressHtml) {
|
||||
innerCardFooter += '<div class="innerCardFooter fullInnerCardFooter innerCardFooterClear">';
|
||||
|
@ -1288,7 +1288,7 @@ import { appRouter } from '../appRouter';
|
|||
logoUrl = null;
|
||||
}
|
||||
|
||||
outerCardFooter = getCardFooterText(item, apiClient, options, footerCssClass, progressHtml, {forceName: forceName, overlayText: overlayText, isOuterFooter: true}, {imgUrl: imgUrl, logoUrl: logoUrl});
|
||||
outerCardFooter = getCardFooterText(item, apiClient, options, footerCssClass, progressHtml, { forceName, overlayText, isOuterFooter: true }, { imgUrl, logoUrl });
|
||||
}
|
||||
|
||||
if (outerCardFooter && !options.cardLayout) {
|
||||
|
|
|
@ -345,7 +345,7 @@ function Guide(options) {
|
|||
}
|
||||
|
||||
apiClient.getLiveTvPrograms(programQuery).then(function (programsResult) {
|
||||
const guideOptions = {focusProgramOnRender: focusProgramOnRender, scrollToTimeMs: scrollToTimeMs, focusToTimeMs: focusToTimeMs, startTimeOfDayMs: startTimeOfDayMs};
|
||||
const guideOptions = { focusProgramOnRender, scrollToTimeMs, focusToTimeMs, startTimeOfDayMs };
|
||||
|
||||
renderGuide(context, date, channelsResult.Items, programsResult.Items, renderOptions, guideOptions, apiClient);
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ import template from './imageeditor.template.html';
|
|||
|
||||
html += '<div class="cardContent">';
|
||||
|
||||
const imageUrl = getImageUrl(currentItem, apiClient, image.ImageType, image.ImageIndex, {maxWidth: options.imageSize});
|
||||
const imageUrl = getImageUrl(currentItem, apiClient, image.ImageType, image.ImageIndex, { maxWidth: options.imageSize });
|
||||
|
||||
html += '<div class="cardImageContainer" style="background-image:url(\'' + imageUrl + '\');background-position:center center;background-size:contain;"></div>';
|
||||
|
||||
|
@ -226,7 +226,7 @@ import template from './imageeditor.template.html';
|
|||
|
||||
for (let i = 0, length = images.length; i < length; i++) {
|
||||
const image = images[i];
|
||||
const options = {index: i, numImages: length, imageProviders: imageProviders, imageSize: imageSize, tagName: tagName, enableFooterButtons: enableFooterButtons};
|
||||
const options = { index: i, numImages: length, imageProviders, imageSize, tagName, enableFooterButtons };
|
||||
html += getCardHtml(image, apiClient, options);
|
||||
}
|
||||
|
||||
|
|
|
@ -344,7 +344,7 @@ function getAudioStreamUrlFromDeviceProfile(item, deviceProfile, maxBitrate, api
|
|||
|
||||
const maxValues = getAudioMaxValues(deviceProfile);
|
||||
|
||||
return getAudioStreamUrl(item, transcodingProfile, directPlayContainers, apiClient, startPosition, { maxBitrate: maxBitrate, ...maxValues });
|
||||
return getAudioStreamUrl(item, transcodingProfile, directPlayContainers, apiClient, startPosition, { maxBitrate, ...maxValues });
|
||||
}
|
||||
|
||||
function getStreamUrls(items, deviceProfile, maxBitrate, apiClient, startPosition) {
|
||||
|
@ -377,7 +377,7 @@ function getStreamUrls(items, deviceProfile, maxBitrate, apiClient, startPositio
|
|||
let streamUrl;
|
||||
|
||||
if (item.MediaType === 'Audio' && !itemHelper.isLocalItem(item)) {
|
||||
streamUrl = getAudioStreamUrl(item, audioTranscodingProfile, audioDirectPlayContainers, apiClient, startPosition, { maxBitrate: maxBitrate, ...maxValues });
|
||||
streamUrl = getAudioStreamUrl(item, audioTranscodingProfile, audioDirectPlayContainers, apiClient, startPosition, { maxBitrate, ...maxValues });
|
||||
}
|
||||
|
||||
streamUrls.push(streamUrl || '');
|
||||
|
@ -1722,11 +1722,11 @@ class PlaybackManager {
|
|||
const currentPlayOptions = currentItem.playOptions || getDefaultPlayOptions();
|
||||
|
||||
const options = {
|
||||
maxBitrate: maxBitrate,
|
||||
maxBitrate,
|
||||
startPosition: ticks,
|
||||
isPlayback: true,
|
||||
audioStreamIndex: audioStreamIndex,
|
||||
subtitleStreamIndex: subtitleStreamIndex,
|
||||
audioStreamIndex,
|
||||
subtitleStreamIndex,
|
||||
enableDirectPlay: params.EnableDirectPlay,
|
||||
enableDirectStream: params.EnableDirectStream,
|
||||
allowVideoStreamCopy: params.AllowVideoStreamCopy,
|
||||
|
@ -2304,9 +2304,9 @@ class PlaybackManager {
|
|||
loading.hide();
|
||||
|
||||
return player.play({
|
||||
items: items,
|
||||
items,
|
||||
startPositionTicks: options.startPosition || 0,
|
||||
mediaSourceId: mediaSourceId,
|
||||
mediaSourceId,
|
||||
audioStreamIndex: options.audioStreamIndex,
|
||||
subtitleStreamIndex: options.subtitleStreamIndex,
|
||||
startIndex: options.startIndex
|
||||
|
@ -2471,11 +2471,11 @@ class PlaybackManager {
|
|||
const audioStreamIndex = playOptions.audioStreamIndex;
|
||||
const subtitleStreamIndex = playOptions.subtitleStreamIndex;
|
||||
const options = {
|
||||
maxBitrate: maxBitrate,
|
||||
startPosition: startPosition,
|
||||
maxBitrate,
|
||||
startPosition,
|
||||
isPlayback: null,
|
||||
audioStreamIndex: audioStreamIndex,
|
||||
subtitleStreamIndex: subtitleStreamIndex,
|
||||
audioStreamIndex,
|
||||
subtitleStreamIndex,
|
||||
startIndex: playOptions.startIndex,
|
||||
enableDirectPlay: null,
|
||||
enableDirectStream: null,
|
||||
|
@ -2549,8 +2549,8 @@ class PlaybackManager {
|
|||
|
||||
return player.getDeviceProfile(item).then(function (deviceProfile) {
|
||||
const mediaOptions = {
|
||||
maxBitrate: maxBitrate,
|
||||
startPosition: startPosition,
|
||||
maxBitrate,
|
||||
startPosition,
|
||||
isPlayback: null,
|
||||
audioStreamIndex: options.audioStreamIndex,
|
||||
subtitleStreamIndex: options.subtitleStreamIndex,
|
||||
|
@ -2582,8 +2582,8 @@ class PlaybackManager {
|
|||
|
||||
return player.getDeviceProfile(item).then(function (deviceProfile) {
|
||||
const mediaOptions = {
|
||||
maxBitrate: maxBitrate,
|
||||
startPosition: startPosition,
|
||||
maxBitrate,
|
||||
startPosition,
|
||||
isPlayback: true,
|
||||
audioStreamIndex: null,
|
||||
subtitleStreamIndex: null,
|
||||
|
|
|
@ -99,12 +99,7 @@ function getIconsHtml(options) {
|
|||
}
|
||||
|
||||
const iconCssClass = options.iconCssClass;
|
||||
|
||||
const classes = {
|
||||
buttonCssClass: btnCssClass,
|
||||
iconCssClass: iconCssClass
|
||||
};
|
||||
|
||||
const classes = { buttonCssClass: btnCssClass, iconCssClass: iconCssClass };
|
||||
const serverId = item.ServerId;
|
||||
|
||||
if (includePlayed !== false) {
|
||||
|
@ -113,7 +108,7 @@ function getIconsHtml(options) {
|
|||
if (itemHelper.canMarkPlayed(item)) {
|
||||
if (userData.Played) {
|
||||
const buttonCssClass = classes.buttonCssClass + ' btnUserDataOn';
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, serverId, 'check', tooltipPlayed, style, {buttonCssClass: buttonCssClass, ...classes});
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, serverId, 'check', tooltipPlayed, style, { buttonCssClass, ...classes });
|
||||
} else {
|
||||
html += getUserDataButtonHtml('markPlayed', itemId, serverId, 'check', tooltipPlayed, style, classes);
|
||||
}
|
||||
|
@ -123,7 +118,7 @@ function getIconsHtml(options) {
|
|||
const tooltipFavorite = globalize.translate('Favorite');
|
||||
if (userData.IsFavorite) {
|
||||
const buttonCssClass = classes.buttonCssClass + ' btnUserData btnUserDataOn';
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, serverId, 'favorite', tooltipFavorite, style, {buttonCssClass: buttonCssClass, ...classes});
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, serverId, 'favorite', tooltipFavorite, style, { buttonCssClass, ...classes });
|
||||
} else {
|
||||
classes.buttonCssClass += ' btnUserData';
|
||||
html += getUserDataButtonHtml('markFavorite', itemId, serverId, 'favorite', tooltipFavorite, style, classes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue