diff --git a/public/config.js b/public/config.js deleted file mode 100644 index 7eb8a8bc..00000000 --- a/public/config.js +++ /dev/null @@ -1,8 +0,0 @@ -window.CONFIG = { - VITE_BACKEND_URL: "https://backend.sudo-flix.lol/", - VITE_CORS_PROXY_URL: "https://sudo-proxy1.sudo-flix.lol%2Chttps//sudo-proxy2.sudo-flix.lol,https://sudo-proxy3.sudo-flix.lol,https://sudo-proxy4.sudo-flix.lol,https://sudo-proxy5.sudo-flix.lol", - VITE_DMCA_EMAIL: "sudo-flix@proton.me", - VITE_GA_ID: "G-3VB2TNCW2V", - VITE_NORMAL_ROUTER: true, - VITE_TMDB_READ_API_KEY: "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZTljNGE2ZDE1ZDFiODZiNzdlMWQyYmI5ZGY0MzdmYyIsInN1YiI6IjY1YjNmMWI0NTk0Yzk0MDE2MzNkZDBjNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.kAX7TkbKuJkNty6IsjcCLnoENFicVZn6d6DkLQsy3p8", -}; diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index a9db3c83..5257cec9 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -395,7 +395,8 @@ }, "nextEpisode": { "replay": "Replay", - "next": "Next episode" + "nextIn": "Next episode in {{seconds}}", + "next": "Next Episode" }, "playbackError": { "badge": "Playback error", diff --git a/src/components/player/atoms/NextEpisodeButton.tsx b/src/components/player/atoms/NextEpisodeButton.tsx index 34f0c79a..f36c18e6 100644 --- a/src/components/player/atoms/NextEpisodeButton.tsx +++ b/src/components/player/atoms/NextEpisodeButton.tsx @@ -19,6 +19,11 @@ function shouldShowNextEpisodeButton( return "none"; } +function shouldStartCountdown(time: number, duration: number): boolean { + const secondsFromEnd = duration - time; + return secondsFromEnd <= 30 || time / duration >= 0.93; +} + function Button(props: { className: string; onClick?: () => void; @@ -88,6 +93,23 @@ export function NextEpisodeButton(props: { props.onChange?.(metaCopy); }, [setDirectMeta, meta, props, setShouldStartFromBeginning]); + const [seconds, setSeconds] = useState(15); + + useEffect(() => { + const interval = setInterval(() => { + setSeconds((prevSeconds) => prevSeconds - 1); + }, 1000); + + return () => clearInterval(interval); + }, []); + + useEffect(() => { + if (seconds === 0) { + loadNextEpisode(); + setSeconds(15); + } + }, [seconds, loadNextEpisode]); + if (!meta?.episode || !nextEp) return null; if (metaType !== "show") return null;