mirror of
https://github.com/p-stream/p-stream.git
synced 2026-01-11 20:10:32 +00:00
Merge branch 'p-stream:production' into substranslate
This commit is contained in:
commit
6b276d32fe
4 changed files with 31 additions and 24 deletions
|
|
@ -1147,7 +1147,8 @@
|
|||
"link": "Migrate my data"
|
||||
},
|
||||
"documentation": "Backend documentation",
|
||||
"error": "Error connecting to backend"
|
||||
"error": "Error connecting to backend",
|
||||
"notice": "Your account does NOT sync between backends, so remember which one you use!"
|
||||
},
|
||||
"setup": {
|
||||
"doSetup": "Do setup",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
import { proxiedFetch } from "@/backend/helpers/fetch";
|
||||
// import { proxiedFetch } from "@/backend/helpers/fetch";
|
||||
import { usePlayerMeta } from "@/components/player/hooks/usePlayerMeta";
|
||||
import { conf } from "@/setup/config";
|
||||
import { usePreferencesStore } from "@/stores/preferences";
|
||||
|
|
@ -8,7 +8,7 @@ import { getTurnstileToken } from "@/utils/turnstile";
|
|||
|
||||
// Thanks Nemo for this API
|
||||
const FED_SKIPS_BASE_URL = "https://fed-skips.pstream.mov";
|
||||
const VELORA_BASE_URL = "https://veloratv.ru/api/intro-end/confirmed";
|
||||
// const VELORA_BASE_URL = "https://veloratv.ru/api/intro-end/confirmed";
|
||||
const MAX_RETRIES = 3;
|
||||
|
||||
export function useSkipTime() {
|
||||
|
|
@ -17,26 +17,26 @@ export function useSkipTime() {
|
|||
const febboxKey = usePreferencesStore((s) => s.febboxKey);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchVeloraSkipTime = async (): Promise<number | null> => {
|
||||
if (!meta?.tmdbId) return null;
|
||||
// const fetchVeloraSkipTime = async (): Promise<number | null> => {
|
||||
// if (!meta?.tmdbId) return null;
|
||||
|
||||
try {
|
||||
let apiUrl = `${VELORA_BASE_URL}?tmdbId=${meta.tmdbId}`;
|
||||
if (meta.type !== "movie") {
|
||||
apiUrl += `&season=${meta.season?.number}&episode=${meta.episode?.number}`;
|
||||
}
|
||||
const data = await proxiedFetch(apiUrl);
|
||||
// try {
|
||||
// let apiUrl = `${VELORA_BASE_URL}?tmdbId=${meta.tmdbId}`;
|
||||
// if (meta.type !== "movie") {
|
||||
// apiUrl += `&season=${meta.season?.number}&episode=${meta.episode?.number}`;
|
||||
// }
|
||||
// const data = await proxiedFetch(apiUrl);
|
||||
|
||||
if (data.introSkippable && typeof data.introEnd === "number") {
|
||||
return data.introEnd;
|
||||
}
|
||||
// if (data.introSkippable && typeof data.introEnd === "number") {
|
||||
// return data.introEnd;
|
||||
// }
|
||||
|
||||
return null;
|
||||
} catch (error) {
|
||||
console.error("Error fetching velora skip time:", error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
// return null;
|
||||
// } catch (error) {
|
||||
// console.error("Error fetching velora skip time:", error);
|
||||
// return null;
|
||||
// }
|
||||
// };
|
||||
|
||||
const fetchFedSkipsTime = async (retries = 0): Promise<number | null> => {
|
||||
if (!meta?.imdbId || meta.type === "movie") return null;
|
||||
|
|
@ -88,13 +88,13 @@ export function useSkipTime() {
|
|||
const fedSkipsTime = await fetchFedSkipsTime();
|
||||
if (fedSkipsTime !== null) {
|
||||
setSkiptime(fedSkipsTime);
|
||||
return;
|
||||
// return;
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to Velora API (available to all users)
|
||||
const veloraSkipTime = await fetchVeloraSkipTime();
|
||||
setSkiptime(veloraSkipTime);
|
||||
// // Fall back to Velora API (available to all users)
|
||||
// const veloraSkipTime = await fetchVeloraSkipTime();
|
||||
// setSkiptime(veloraSkipTime);
|
||||
};
|
||||
|
||||
fetchSkipTime();
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ export function LoginPage() {
|
|||
showCustom
|
||||
/>
|
||||
<LargeCardButtons>
|
||||
<span className="text-type-danger font-medium text-center">
|
||||
{t("settings.connections.server.notice")}
|
||||
</span>
|
||||
<Button
|
||||
theme="purple"
|
||||
onClick={handleContinue}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,9 @@ export function RegisterPage() {
|
|||
showCustom
|
||||
/>
|
||||
<LargeCardButtons>
|
||||
<span className="text-type-danger font-medium text-center">
|
||||
{t("settings.connections.server.notice")}
|
||||
</span>
|
||||
<Button
|
||||
theme="purple"
|
||||
onClick={() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue