mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3609 from sancodes/eslint-no-sequences
Eslint no sequences
This commit is contained in:
commit
79db34a2a7
11 changed files with 41 additions and 14 deletions
|
@ -61,7 +61,8 @@ module.exports = {
|
|||
'no-var': ['error'],
|
||||
'space-before-blocks': ['error'],
|
||||
'space-infix-ops': 'error',
|
||||
'yoda': 'error'
|
||||
'yoda': 'error',
|
||||
'no-sequences': ['error', { 'allowInParentheses': false }]
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
|
|
|
@ -75,7 +75,9 @@ function replaceAll(originalString, strReplace, strWith) {
|
|||
function generateDeviceId() {
|
||||
const keys = [];
|
||||
|
||||
if (keys.push(navigator.userAgent), keys.push(new Date().getTime()), window.btoa) {
|
||||
keys.push(navigator.userAgent);
|
||||
keys.push(new Date().getTime());
|
||||
if (window.btoa) {
|
||||
const result = replaceAll(btoa(keys.join('|')), '=', '1');
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,9 @@ import '../elements/emby-itemscontainer/emby-itemscontainer';
|
|||
let html = '';
|
||||
|
||||
if (result.Items.length) {
|
||||
if (html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">', !layoutManager.tv && options.Limit && result.Items.length >= options.Limit) {
|
||||
html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
|
||||
|
||||
if (!layoutManager.tv && options.Limit && result.Items.length >= options.Limit) {
|
||||
html += '<a is="emby-linkbutton" href="' + ('#!/list.html?serverId=' + ApiClient.serverId() + '&type=' + section.types + '&IsFavorite=true') + '" class="more button-flat button-flat-mini sectionTitleTextButton">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">';
|
||||
html += globalize.translate(section.name);
|
||||
|
|
|
@ -64,7 +64,12 @@ import template from './libraryoptionseditor.template.html';
|
|||
let html = '';
|
||||
const elem = page.querySelector('.metadataReaders');
|
||||
|
||||
if (plugins.length < 1) return elem.innerHTML = '', elem.classList.add('hide'), !1;
|
||||
if (plugins.length < 1) {
|
||||
elem.innerHTML = '';
|
||||
elem.classList.add('hide');
|
||||
return false;
|
||||
}
|
||||
|
||||
html += `<h3 class="checkboxListLabel">${globalize.translate('LabelMetadataReaders')}</h3>`;
|
||||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
for (let i = 0; i < plugins.length; i++) {
|
||||
|
@ -97,7 +102,11 @@ import template from './libraryoptionseditor.template.html';
|
|||
function renderMetadataSavers(page, metadataSavers) {
|
||||
let html = '';
|
||||
const elem = page.querySelector('.metadataSavers');
|
||||
if (!metadataSavers.length) return elem.innerHTML = '', elem.classList.add('hide'), false;
|
||||
if (!metadataSavers.length) {
|
||||
elem.innerHTML = '';
|
||||
elem.classList.add('hide');
|
||||
return false;
|
||||
}
|
||||
html += `<h3 class="checkboxListLabel">${globalize.translate('LabelMetadataSavers')}</h3>`;
|
||||
html += '<div class="checkboxList paperList checkboxList-paperList">';
|
||||
for (let i = 0; i < metadataSavers.length; i++) {
|
||||
|
|
|
@ -646,7 +646,10 @@ export default function () {
|
|||
}
|
||||
|
||||
function bindToPlayer(context, player) {
|
||||
if (releaseCurrentPlayer(), currentPlayer = player, player) {
|
||||
releaseCurrentPlayer();
|
||||
currentPlayer = player;
|
||||
|
||||
if (player) {
|
||||
const state = playbackManager.getPlayerState(player);
|
||||
onStateChanged.call(player, {
|
||||
type: 'init'
|
||||
|
|
|
@ -43,11 +43,13 @@ import Dashboard from '../../utils/dashboard';
|
|||
|
||||
function onSubmit() {
|
||||
const form = this;
|
||||
return loading.show(), ApiClient.getServerConfiguration().then(function(config) {
|
||||
loading.show();
|
||||
ApiClient.getServerConfiguration().then(function(config) {
|
||||
config.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value;
|
||||
config.MetadataCountryCode = form.querySelector('#selectCountry').value;
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
}), !1;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
|
|
|
@ -145,7 +145,7 @@ import ServerConnections from '../components/ServerConnections';
|
|||
return function () {
|
||||
const apiClient = this.apiClient;
|
||||
const options = {
|
||||
SortBy: (section.types, 'SeriesName,SortName'),
|
||||
SortBy: 'SeriesName,SortName',
|
||||
SortOrder: 'Ascending',
|
||||
Filters: 'IsFavorite',
|
||||
Recursive: true,
|
||||
|
@ -278,7 +278,7 @@ class FavoritesTab {
|
|||
}
|
||||
|
||||
onResume(options) {
|
||||
const promises = (this.apiClient, []);
|
||||
const promises = [];
|
||||
const view = this.view;
|
||||
const elems = this.sectionsContainer.querySelectorAll('.itemsContainer');
|
||||
|
||||
|
|
|
@ -1786,7 +1786,11 @@ function renderAdditionalParts(page, item, user) {
|
|||
function renderScenes(page, item) {
|
||||
let chapters = item.Chapters || [];
|
||||
|
||||
if (chapters.length && !chapters[0].ImageTag && (chapters = []), chapters.length) {
|
||||
if (chapters.length && !chapters[0].ImageTag) {
|
||||
chapters = [];
|
||||
}
|
||||
|
||||
if (chapters.length) {
|
||||
page.querySelector('#scenesCollapsible').classList.remove('hide');
|
||||
const scenesContent = page.querySelector('#scenesContent');
|
||||
|
||||
|
|
|
@ -1173,7 +1173,7 @@ class ItemsView {
|
|||
}
|
||||
|
||||
getVisibleViewSettings() {
|
||||
const item = (this.params, this.currentItem);
|
||||
const item = this.currentItem;
|
||||
const fields = ['showTitle'];
|
||||
|
||||
if (!item || item.Type !== 'PhotoAlbum' && item.Type !== 'ChannelFolderItem') {
|
||||
|
|
|
@ -745,7 +745,9 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
|||
const currentTimeMs = (playbackStartTimeTicks + (positionTicks || 0)) / 1e4;
|
||||
const programRuntimeMs = programEndDateMs - programStartDateMs;
|
||||
|
||||
if (nowPlayingPositionSlider.value = getDisplayPercentByTimeOfDay(programStartDateMs, programRuntimeMs, currentTimeMs), bufferedRanges.length) {
|
||||
nowPlayingPositionSlider.value = getDisplayPercentByTimeOfDay(programStartDateMs, programRuntimeMs, currentTimeMs);
|
||||
|
||||
if (bufferedRanges.length) {
|
||||
const rangeStart = getDisplayPercentByTimeOfDay(programStartDateMs, programRuntimeMs, (playbackStartTimeTicks + (bufferedRanges[0].start || 0)) / 1e4);
|
||||
const rangeEnd = getDisplayPercentByTimeOfDay(programStartDateMs, programRuntimeMs, (playbackStartTimeTicks + (bufferedRanges[0].end || 0)) / 1e4);
|
||||
nowPlayingPositionSlider.setBufferedRanges([{
|
||||
|
|
|
@ -86,7 +86,9 @@ export function getQueryPagingHtml (options) {
|
|||
const recordsEnd = Math.min(startIndex + limit, totalRecordCount);
|
||||
const showControls = limit < totalRecordCount;
|
||||
|
||||
if (html += '<div class="listPaging">', showControls) {
|
||||
html += '<div class="listPaging">';
|
||||
|
||||
if (showControls) {
|
||||
html += '<span style="vertical-align:middle;">';
|
||||
html += globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), recordsEnd, totalRecordCount);
|
||||
html += '</span>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue