diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index 23bd8e5aeb..ef67508b95 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -550,13 +550,9 @@ import template from './libraryoptionseditor.template.html'; function getOrderedPlugins(plugins, configuredOrder) { plugins = plugins.slice(0); plugins.sort((a, b) => { - let order = 0; - if (a < b) { - order = -1; - } else if (a > b) { - order = 1; - } - return a = configuredOrder.indexOf(a.Name), b = configuredOrder.indexOf(b.Name), order; + a = configuredOrder.indexOf(a.Name); + b = configuredOrder.indexOf(b.Name); + return a - b; }); return plugins; } diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index 691f1c0f30..3f16ca61b8 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -27,6 +27,8 @@ import LibraryMenu from '../../../scripts/libraryMenu'; import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components/backdrop/backdrop'; /* eslint-disable indent */ + const TICKS_PER_MINUTE = 600000000; + const TICKS_PER_SECOND = 10000000; function getOpenedDialog() { return document.querySelector('.dialogContainer .dialog.opened'); @@ -588,15 +590,15 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components function showComingUpNextIfNeeded(player, currentItem, currentTimeTicks, runtimeTicks) { if (runtimeTicks && currentTimeTicks && !comingUpNextDisplayed && !currentVisibleMenu && currentItem.Type === 'Episode' && userSettings.enableNextVideoInfoOverlay()) { let showAtSecondsLeft = 30; - if (runtimeTicks >= 3e10) { + if (runtimeTicks >= 50 * TICKS_PER_MINUTE) { showAtSecondsLeft = 40; - } else if (runtimeTicks >= 2.4e10) { + } else if (runtimeTicks >= 40 * TICKS_PER_MINUTE) { showAtSecondsLeft = 35; } - const showAtTicks = runtimeTicks - 1e3 * showAtSecondsLeft * 1e4; + const showAtTicks = runtimeTicks - showAtSecondsLeft * TICKS_PER_SECOND; const timeRemainingTicks = runtimeTicks - currentTimeTicks; - if (currentTimeTicks >= showAtTicks && runtimeTicks >= 6e9 && timeRemainingTicks >= 2e8) { + if (currentTimeTicks >= showAtTicks && runtimeTicks >= (10 * TICKS_PER_MINUTE) && timeRemainingTicks >= (20 * TICKS_PER_SECOND)) { showComingUpNext(player); } } diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index e83e8a5cdd..d1e91183af 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -387,7 +387,7 @@ import browser from './browser'; } /* eslint-disable compat/compat */ - let maxVideoWidth = (browser.xboxOne && window.screen) ? window.screen.width : null; + let maxVideoWidth = browser.xboxOne ? window.screen?.width : null; /* eslint-enable compat/compat */ if (options.maxVideoWidth) {