mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Merge branch 'main' of https://github.com/sussy-code/smov
This commit is contained in:
commit
0fd25815a3
7 changed files with 31 additions and 50 deletions
|
@ -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)*
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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,16 +99,10 @@ 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 && (
|
|
||||||
<div className="text-white mb-2">
|
|
||||||
{t("player.nextEpisode.nextIn", { seconds: countdown })}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="flex items-center space-x-3">
|
|
||||||
<Button
|
<Button
|
||||||
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
className="py-px box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
|
||||||
onClick={() => startCurrentEpisodeFromBeginning()}
|
onClick={() => startCurrentEpisodeFromBeginning()}
|
||||||
|
@ -141,7 +117,6 @@ export function NextEpisodeButton(props: {
|
||||||
{t("player.nextEpisode.next")}
|
{t("player.nextEpisode.next")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Transition>
|
</Transition>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>,
|
||||||
]}
|
]}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue