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) |
| 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) |
| 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.**
@ -28,7 +28,7 @@ Sudo-Flix is a mirror of [Movie-Web](https://github.com/movie-web/movie-web) wit
## Running Locally
Type the following commands into your terminal / command line to run Sudo-Flix locally
```bash
git clone https://github.com/sudo-flix/sudo-source.git
git clone https://github.com/sussy-code/smov.git
cd sudo-flix
git pull
pnpm install
@ -42,7 +42,7 @@ Then you can visit the local instance [here](http://localhost:5173) or, at local
### sudo-flix
To update a sudo-flix instance you can type the below commands into a terminal at the root of your project.
```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 checkout <YOUR_MAIN_BRANCH> # Most likely this would be `origin/main`
git merge upstream/main
@ -72,4 +72,4 @@ git push # Push to YOUR repository
## Contact Me
**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 = {
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_DMCA_EMAIL: "dev@sudo-flix.lol",
VITE_GA_ID: "G-3VB2TNCW2V",
VITE_NORMAL_ROUTER: true,
VITE_TMDB_READ_API_KEY: "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZTljNGE2ZDE1ZDFiODZiNzdlMWQyYmI5ZGY0MzdmYyIsInN1YiI6IjY1YjNmMWI0NTk0Yzk0MDE2MzNkZDBjNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.kAX7TkbKuJkNty6IsjcCLnoENFicVZn6d6DkLQsy3p8",

View file

@ -453,7 +453,7 @@
},
"screens": {
"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 :("
},
"loadingApp": "Loading application",

View file

@ -1,5 +1,5 @@
import classNames from "classnames";
import React, { useCallback, useEffect, useState } from "react";
import React, { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { Icon, Icons } from "@/components/Icon";
@ -15,7 +15,7 @@ function shouldShowNextEpisodeButton(
const percentage = time / duration;
const secondsFromEnd = duration - time;
if (secondsFromEnd <= 30) return "always";
if (percentage >= 0.93) return "hover";
if (percentage >= 0.94) return "hover";
return "none";
}
@ -54,30 +54,12 @@ export function NextEpisodeButton(props: {
const setShouldStartFromBeginning = usePlayerStore(
(s) => s.setShouldStartFromBeginning,
);
const [countdown, setCountdown] = useState(15);
let show = false;
if (showingState === "always") show = true;
else if (showingState === "hover" && props.controlsShowing) show = true;
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";
let bottom = "bottom-[calc(6rem+env(safe-area-inset-bottom))]";
if (showingState === "always")
@ -117,16 +99,10 @@ export function NextEpisodeButton(props: {
>
<div
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,
])}
>
{countdown > 0 && show && (
<div className="text-white mb-2">
{t("player.nextEpisode.nextIn", { seconds: countdown })}
</div>
)}
<div className="flex items-center space-x-3">
<Button
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
onClick={() => startCurrentEpisodeFromBeginning()}
@ -141,7 +117,6 @@ export function NextEpisodeButton(props: {
{t("player.nextEpisode.next")}
</Button>
</div>
</div>
</Transition>
);
}

View file

@ -41,8 +41,13 @@ export function Volume(props: Props) {
const handleMouseEnter = useCallback(async () => {
if (await canChangeVolume()) setHovering(true);
document.body.classList.add("overflow-y-hidden");
}, [setHovering]);
const handleMouseLeave = () => {
document.body.classList.remove("overflow-y-hidden");
};
let percentage = makePercentage(volume * 100);
if (dragging) percentage = makePercentage(dragPercentage);
const percentageString = makePercentageString(percentage);
@ -61,9 +66,10 @@ export function Volume(props: Props) {
<div
className={props.className}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
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}>
<Icon icon={percentage > 0 ? Icons.VOLUME : Icons.VOLUME_X} />
</div>

View file

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

View file

@ -1,6 +1,6 @@
export const APP_VERSION = import.meta.env.PACKAGE_VERSION;
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 DONATION_LINK = "https://ko-fi.com/movieweb";
export const GA_ID = import.meta.env.VITE_GA_ID;