Skip to content

Commit

Permalink
Show Skip Button When 'Next Video Info Overlay' is Disabled (#6258)
Browse files Browse the repository at this point in the history
* Show Skip Button When 'Next Video Info Overlay' is Disabled

* Update skipsegment.ts

* Apply Suggestions

Co-authored-by: Bill Thornton <[email protected]>

* Apply Suggestions

Co-authored-by: Bill Thornton <[email protected]>

---------

Co-authored-by: rlauu <[email protected]>
Co-authored-by: Bill Thornton <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 7ccc494 commit 3311a14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/playback/skipsegment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/controllers/playback/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/settings/userSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3311a14

Please sign in to comment.