1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00
This commit is contained in:
Cooper Ransom 2024-03-22 20:48:48 -04:00
commit 0fd25815a3
7 changed files with 31 additions and 50 deletions

View file

@ -11,7 +11,7 @@ Sudo-Flix is a mirror of [Movie-Web](https://github.com/movie-web/movie-web) wit
| Extension | [movie-web plugin](https://shorturl.at/iqzES) | [Source Code](https://github.com/movie-web/extension) | | Extension | [movie-web plugin](https://shorturl.at/iqzES) | [Source Code](https://github.com/movie-web/extension) |
| Proxy | [sudo-proxy](https://sudo-proxy1.sudo-flix.lol) | [Source Code](https://gitlab.com/sudo-flix/simple-proxy) | | Proxy | [sudo-proxy](https://sudo-proxy1.sudo-flix.lol) | [Source Code](https://gitlab.com/sudo-flix/simple-proxy) |
| Backend | [sudo-backend](https://backend.sudo-flix.lol) | [Source Code](https://github.com/movie-web/backend) | | Backend | [sudo-backend](https://backend.sudo-flix.lol) | [Source Code](https://github.com/movie-web/backend) |
| Frontend | [sudo-flix](https://sudo-flix.lol) | [Source Code](https://github.com/sudo-flix/sudo-source) | | Frontend | [sudo-flix](https://sudo-flix.lol) | [Source Code](https://github.com/sussy-code/smov) |
**I provide these if you are not able to host yourself, though I do encourage hosting the frontend.** **I provide these if you are not able to host yourself, though I do encourage hosting the frontend.**
@ -28,7 +28,7 @@ Sudo-Flix is a mirror of [Movie-Web](https://github.com/movie-web/movie-web) wit
## Running Locally ## Running Locally
Type the following commands into your terminal / command line to run Sudo-Flix locally Type the following commands into your terminal / command line to run Sudo-Flix locally
```bash ```bash
git clone https://github.com/sudo-flix/sudo-source.git git clone https://github.com/sussy-code/smov.git
cd sudo-flix cd sudo-flix
git pull git pull
pnpm install pnpm install
@ -42,7 +42,7 @@ Then you can visit the local instance [here](http://localhost:5173) or, at local
### sudo-flix ### sudo-flix
To update a sudo-flix instance you can type the below commands into a terminal at the root of your project. To update a sudo-flix instance you can type the below commands into a terminal at the root of your project.
```bash ```bash
git remote add upstream https://github.com/sudo-flix/sudo-source.git git remote add upstream https://github.com/sussy-code/smov.git
git fetch sudo-flix # Grab the contents of the new remote source git fetch sudo-flix # Grab the contents of the new remote source
git checkout <YOUR_MAIN_BRANCH> # Most likely this would be `origin/main` git checkout <YOUR_MAIN_BRANCH> # Most likely this would be `origin/main`
git merge upstream/main git merge upstream/main
@ -72,4 +72,4 @@ git push # Push to YOUR repository
## Contact Me ## Contact Me
**Discord:** *.baddeveloper* **Discord:** *.baddeveloper*
**Email:** *[sudo-flix@proton.me](mailto:sudo-flix@proton.me)* **Email:** *[dev@sudo-flix.lol](mailto:dev@sudo-flix.lol)*

View file

@ -1,7 +1,7 @@
window.CONFIG = { window.CONFIG = {
VITE_BACKEND_URL: "https://backend.sudo-flix.lol/", 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_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_DMCA_EMAIL: "dev@sudo-flix.lol",
VITE_GA_ID: "G-3VB2TNCW2V", VITE_GA_ID: "G-3VB2TNCW2V",
VITE_NORMAL_ROUTER: true, VITE_NORMAL_ROUTER: true,
VITE_TMDB_READ_API_KEY: "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZTljNGE2ZDE1ZDFiODZiNzdlMWQyYmI5ZGY0MzdmYyIsInN1YiI6IjY1YjNmMWI0NTk0Yzk0MDE2MzNkZDBjNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.kAX7TkbKuJkNty6IsjcCLnoENFicVZn6d6DkLQsy3p8", VITE_TMDB_READ_API_KEY: "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZTljNGE2ZDE1ZDFiODZiNzdlMWQyYmI5ZGY0MzdmYyIsInN1YiI6IjY1YjNmMWI0NTk0Yzk0MDE2MzNkZDBjNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.kAX7TkbKuJkNty6IsjcCLnoENFicVZn6d6DkLQsy3p8",

View file

@ -453,7 +453,7 @@
}, },
"screens": { "screens": {
"dmca": { "dmca": {
"text": "Welcome to sudo-flix's DMCA contact page. If you believe your copyrighted work has been improperly used on our platform (😢), please send a detailed DMCA notice to: <bold>sudo-flix@proton.me</bold> below. Please include a description of the copyrighted material, your contact details, and a statement of good faith belief. We're committed to resolving these matters promptly and appreciate your cooperation.", "text": "Welcome to sudo-flix's DMCA contact page. If you believe your copyrighted work has been improperly used on our platform (😢), please send a detailed DMCA notice to: <bold>dev@sudo-flix.lol</bold> below. Please include a description of the copyrighted material, your contact details, and a statement of good faith belief. We're committed to resolving these matters promptly and appreciate your cooperation.",
"title": "DMCA :(" "title": "DMCA :("
}, },
"loadingApp": "Loading application", "loadingApp": "Loading application",

View file

@ -1,5 +1,5 @@
import classNames from "classnames"; import classNames from "classnames";
import React, { useCallback, useEffect, useState } from "react"; import React, { useCallback } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Icon, Icons } from "@/components/Icon"; import { Icon, Icons } from "@/components/Icon";
@ -15,7 +15,7 @@ function shouldShowNextEpisodeButton(
const percentage = time / duration; const percentage = time / duration;
const secondsFromEnd = duration - time; const secondsFromEnd = duration - time;
if (secondsFromEnd <= 30) return "always"; if (secondsFromEnd <= 30) return "always";
if (percentage >= 0.93) return "hover"; if (percentage >= 0.94) return "hover";
return "none"; return "none";
} }
@ -54,30 +54,12 @@ export function NextEpisodeButton(props: {
const setShouldStartFromBeginning = usePlayerStore( const setShouldStartFromBeginning = usePlayerStore(
(s) => s.setShouldStartFromBeginning, (s) => s.setShouldStartFromBeginning,
); );
const [countdown, setCountdown] = useState(15);
let show = false; let show = false;
if (showingState === "always") show = true; if (showingState === "always") show = true;
else if (showingState === "hover" && props.controlsShowing) show = true; else if (showingState === "hover" && props.controlsShowing) show = true;
if (isHidden || status !== "playing" || duration === 0) show = false; if (isHidden || status !== "playing" || duration === 0) show = false;
useEffect(() => {
// Initialize intervalId with 0, which is a safe value to clear if not reassigned.
let intervalId: number = 0;
if (show && countdown > 0) {
intervalId = window.setInterval(() => {
setCountdown((currentCountdown) => currentCountdown - 1);
}, 1000);
} else {
window.clearInterval(intervalId); // No need for casting here.
if (!show) {
setCountdown(15); // Reset countdown when not showing.
}
}
// Cleanup function to clear the interval when the component unmounts or the dependencies change.
return () => window.clearInterval(intervalId);
}, [show, countdown]);
const animation = showingState === "hover" ? "slide-up" : "fade"; const animation = showingState === "hover" ? "slide-up" : "fade";
let bottom = "bottom-[calc(6rem+env(safe-area-inset-bottom))]"; let bottom = "bottom-[calc(6rem+env(safe-area-inset-bottom))]";
if (showingState === "always") if (showingState === "always")
@ -117,30 +99,23 @@ export function NextEpisodeButton(props: {
> >
<div <div
className={classNames([ className={classNames([
"absolute bottom-0 right-0 transition-[bottom] duration-200 flex flex-col items-center space-y-3", "absolute bottom-0 right-0 transition-[bottom] duration-200 flex items-center space-x-3",
bottom, bottom,
])} ])}
> >
{countdown > 0 && show && ( <Button
<div className="text-white mb-2"> className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
{t("player.nextEpisode.nextIn", { seconds: countdown })} onClick={() => startCurrentEpisodeFromBeginning()}
</div> >
)} {t("player.nextEpisode.replay")}
<div className="flex items-center space-x-3"> </Button>
<Button <Button
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center" onClick={() => loadNextEpisode()}
onClick={() => startCurrentEpisodeFromBeginning()} className="bg-buttons-primary hover:bg-buttons-primaryHover text-buttons-primaryText flex justify-center items-center"
> >
{t("player.nextEpisode.replay")} <Icon className="text-xl mr-1" icon={Icons.SKIP_EPISODE} />
</Button> {t("player.nextEpisode.next")}
<Button </Button>
onClick={() => loadNextEpisode()}
className="bg-buttons-primary hover:bg-buttons-primaryHover text-buttons-primaryText flex justify-center items-center"
>
<Icon className="text-xl mr-1" icon={Icons.SKIP_EPISODE} />
{t("player.nextEpisode.next")}
</Button>
</div>
</div> </div>
</Transition> </Transition>
); );

View file

@ -41,8 +41,13 @@ export function Volume(props: Props) {
const handleMouseEnter = useCallback(async () => { const handleMouseEnter = useCallback(async () => {
if (await canChangeVolume()) setHovering(true); if (await canChangeVolume()) setHovering(true);
document.body.classList.add("overflow-y-hidden");
}, [setHovering]); }, [setHovering]);
const handleMouseLeave = () => {
document.body.classList.remove("overflow-y-hidden");
};
let percentage = makePercentage(volume * 100); let percentage = makePercentage(volume * 100);
if (dragging) percentage = makePercentage(dragPercentage); if (dragging) percentage = makePercentage(dragPercentage);
const percentageString = makePercentageString(percentage); const percentageString = makePercentageString(percentage);
@ -61,9 +66,10 @@ export function Volume(props: Props) {
<div <div
className={props.className} className={props.className}
onMouseEnter={handleMouseEnter} onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onWheel={handleWheel} onWheel={handleWheel}
> >
<div className="pointer-events-auto flex cursor-pointer items-center py-0"> <div className="pointer-events-auto flex cursor-pointer items-center py-0 touch-none">
<div className="px-4 text-2xl text-white" onClick={handleClick}> <div className="px-4 text-2xl text-white" onClick={handleClick}>
<Icon icon={percentage > 0 ? Icons.VOLUME : Icons.VOLUME_X} /> <Icon icon={percentage > 0 ? Icons.VOLUME : Icons.VOLUME_X} />
</div> </div>

View file

@ -91,7 +91,7 @@ export function SupportPage() {
</Item>, </Item>,
<Item title={t("support.q2.title")}> <Item title={t("support.q2.title")}>
<Trans i18nKey="support.q2.body"> <Trans i18nKey="support.q2.body">
<MwLink to="https://github.com/sudo-flix/sudo-source" /> <MwLink to="https://github.com/sussy-code/smov" />
</Trans> </Trans>
</Item>, </Item>,
]} ]}

View file

@ -1,6 +1,6 @@
export const APP_VERSION = import.meta.env.PACKAGE_VERSION; export const APP_VERSION = import.meta.env.PACKAGE_VERSION;
export const DISCORD_LINK = "https://movie-web.github.io/links/discord"; export const DISCORD_LINK = "https://movie-web.github.io/links/discord";
export const GITHUB_LINK = "https://github.com/sudo-flix/sudo-source"; export const GITHUB_LINK = "https://github.com/sussy-code/smov";
export const TWITTER_LINK = "https://twitter.com/SudoFlix"; export const TWITTER_LINK = "https://twitter.com/SudoFlix";
export const DONATION_LINK = "https://ko-fi.com/movieweb"; export const DONATION_LINK = "https://ko-fi.com/movieweb";
export const GA_ID = import.meta.env.VITE_GA_ID; export const GA_ID = import.meta.env.VITE_GA_ID;