From 8e3d96cb9813bda63f540f122b4c9b3a186495d3 Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Fri, 10 Jul 2026 19:31:13 +0300 Subject: [PATCH] fix: separate episode navigation and playback --- src/components/Video/Video.js | 41 +++++++++++++++++++++++++------- src/components/Video/styles.less | 25 ++++++++++++++++++- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/components/Video/Video.js b/src/components/Video/Video.js index 409c4ae964..d2c902bc2e 100644 --- a/src/components/Video/Video.js +++ b/src/components/Video/Video.js @@ -66,19 +66,29 @@ const Video = ({ className, id, title, thumbnail, season, episode, released, upc closeMenu(); onMarkSeasonAsWatched(season, seasonWatched); }, [season, seasonWatched, onMarkSeasonAsWatched]); - const videoButtonOnClick = React.useCallback(() => { + const selectVideo = React.useCallback(() => { if (typeof onSelect === 'function') { onSelect(); } + }, [onSelect]); + const videoButtonOnClick = React.useCallback(() => { + selectVideo(); - if (deepLinks) { - if (typeof deepLinks.player === 'string') { - navigate(toPath(deepLinks.player)); - } else if (typeof deepLinks.metaDetailsStreams === 'string') { - navigate(toPath(deepLinks.metaDetailsStreams), { replace: !platform.isMobile }); - } + if (deepLinks && typeof deepLinks.metaDetailsStreams === 'string') { + navigate(toPath(deepLinks.metaDetailsStreams), { replace: !platform.isMobile }); + } + }, [deepLinks, navigate, platform.isMobile, selectVideo]); + const playButtonOnClick = React.useCallback((event) => { + event.preventDefault(); + event.stopPropagation(); + selectVideo(); + if (deepLinks && typeof deepLinks.player === 'string') { + navigate(toPath(deepLinks.player)); } - }, [deepLinks, onSelect]); + }, [deepLinks, navigate, selectVideo]); + const playButtonOnKeyDown = React.useCallback((event) => { + event.stopPropagation(); + }, []); const renderLabel = React.useMemo(() => function renderLabel({ className, id, title, thumbnail, episode, released, upcoming, watched, progress, scheduled, children, ref, ...props }) { const blurThumbnail = profile.settings.hideSpoilers && season && episode && !watched; @@ -163,10 +173,23 @@ const Video = ({ className, id, title, thumbnail, season, episode, released, upc + { + deepLinks && typeof deepLinks.player === 'string' ? + + : + null + } {children} ); - }, [selected]); + }, [deepLinks, playButtonOnClick, playButtonOnKeyDown, selected]); const renderMenu = React.useMemo(() => function renderMenu() { return (
diff --git a/src/components/Video/styles.less b/src/components/Video/styles.less index 907c9a9437..70804f316e 100644 --- a/src/components/Video/styles.less +++ b/src/components/Video/styles.less @@ -177,6 +177,29 @@ } } + .play-button-container { + flex: none; + display: flex; + align-items: center; + justify-content: center; + width: 3rem; + height: 3rem; + margin-right: 0.5rem; + border-radius: 50%; + color: var(--primary-foreground-color); + background-color: var(--overlay-color); + + &:hover, + &:focus { + background-color: var(--secondary-accent-color); + } + + .play-icon { + width: 1.5rem; + height: 1.5rem; + } + } + &.selected { animation: border 3s ease-in-out forwards; } @@ -243,4 +266,4 @@ } } } -} \ No newline at end of file +}