BREAKING: refactor: support api changes from player-parsers

BREAKING: environment variables NEXT_PUBLIC_*_PARSER_URL has been renamed to NEXT_PUBLIC_PLAYER_PARSER_URL

refactor: disable player experiment toggle if env var has not been found
fix/player-parsers(sibnet): add proto to media url response
This commit is contained in:
Kentai Radiquum 2025-07-07 15:14:37 +05:00
parent bfef935fd6
commit 869c934af2
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
5 changed files with 51 additions and 162 deletions

View file

@ -16,6 +16,8 @@ import {
useThemeMode,
} from "flowbite-react";
import Link from "next/link";
import { env } from "next-runtime-env";
import { useEffect, useState } from "react";
const HomeCategory = {
last: "Последние релизы",
@ -51,6 +53,14 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {
const userStore = useUserStore();
const { computedMode, setMode } = useThemeMode();
const [isPlayerConfigured, setIsPlayerConfigured] = useState(false);
useEffect(() => {
const NEXT_PUBLIC_PLAYER_PARSER_URL = env("NEXT_PUBLIC_PLAYER_PARSER_URL") || null;
if (NEXT_PUBLIC_PLAYER_PARSER_URL) {
setIsPlayerConfigured(true);
}
}, []);
return (
<Modal
@ -290,6 +300,7 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {
})
}
checked={preferenceStore.params.experimental.newPlayer}
disabled={!isPlayerConfigured}
/>
</div>
</div>