From 3311a1407f7f6cf2c802afdf1f6086d21192a374 Mon Sep 17 00:00:00 2001 From: rlauuzo <46294892+rlauuzo@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:18:33 +0100 Subject: [PATCH] Show Skip Button When 'Next Video Info Overlay' is Disabled (#6258) * Show Skip Button When 'Next Video Info Overlay' is Disabled * Update skipsegment.ts * Apply Suggestions Co-authored-by: Bill Thornton * Apply Suggestions Co-authored-by: Bill Thornton --------- Co-authored-by: rlauu <46294892+rlauu@users.noreply.github.com> Co-authored-by: Bill Thornton --- src/components/playback/skipsegment.ts | 4 +++- src/controllers/playback/video/index.js | 1 + src/scripts/settings/userSettings.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/playback/skipsegment.ts b/src/components/playback/skipsegment.ts index 458297d682..e77c00d094 100644 --- a/src/components/playback/skipsegment.ts +++ b/src/components/playback/skipsegment.ts @@ -3,11 +3,12 @@ import { TICKS_PER_MILLISECOND, TICKS_PER_SECOND } from 'constants/time'; import type { MediaSegmentDto } from '@jellyfin/sdk/lib/generated-client/models/media-segment-dto'; import { PlaybackSubscriber } from 'apps/stable/features/playback/utils/playbackSubscriber'; import { isInSegment } from 'apps/stable/features/playback/utils/mediaSegments'; -import Events, { type Event } from '../../utils/events'; +import Events, { type Event } from 'utils/events'; import { EventType } from 'types/eventType'; import './skipbutton.scss'; import dom from 'scripts/dom'; import globalize from 'lib/globalize'; +import * as userSettings from 'scripts/settings/userSettings'; interface ShowOptions { animate?: boolean; @@ -127,6 +128,7 @@ class SkipSegment extends PlaybackSubscriber { if (this.player && segment.EndTicks != null && segment.EndTicks >= this.playbackManager.currentItem(this.player).RunTimeTicks && this.playbackManager.getNextItem() + && userSettings.enableNextVideoInfoOverlay() ) { // Don't display button when UpNextDialog is expected. return; diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index df0dde9bb8..aadadf130f 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -637,6 +637,7 @@ export default function (view) { if (mediaSegment && player && mediaSegment.EndTicks != null && mediaSegment.EndTicks >= playbackManager.duration(player) && playbackManager.getNextItem() + && userSettings.enableNextVideoInfoOverlay() ) { showComingUpNext(player); } diff --git a/src/scripts/settings/userSettings.js b/src/scripts/settings/userSettings.js index 27de2f2641..453dba2cc8 100644 --- a/src/scripts/settings/userSettings.js +++ b/src/scripts/settings/userSettings.js @@ -173,7 +173,7 @@ export class UserSettings { /** * Get or set 'Next Video Info Overlay' state. - * @param {boolean|undefined} val - Flag to enable 'Next Video Info Overlay' or undefined. + * @param {boolean|undefined} [val] - Flag to enable 'Next Video Info Overlay' or undefined. * @return {boolean} 'Next Video Info Overlay' state. */ enableNextVideoInfoOverlay(val) {