diff --git a/src/pages/parts/player/ScrapeErrorPart.tsx b/src/pages/parts/player/ScrapeErrorPart.tsx index cff8cece..5b9b39ff 100644 --- a/src/pages/parts/player/ScrapeErrorPart.tsx +++ b/src/pages/parts/player/ScrapeErrorPart.tsx @@ -11,7 +11,11 @@ import { Paragraph } from "@/components/text/Paragraph"; import { Title } from "@/components/text/Title"; import { ScrapingItems, ScrapingSegment } from "@/hooks/useProviderScrape"; import { ErrorContainer, ErrorLayout } from "@/pages/layouts/ErrorLayout"; -import { getExtensionState } from "@/utils/extension"; +import { + ExtensionVersion, + getExtensionState, + getExtensionVersion, +} from "@/utils/extension"; import type { ExtensionStatus } from "@/utils/extension"; import { getProviderApiUrls } from "@/utils/proxyUrls"; @@ -30,6 +34,8 @@ export function ScrapeErrorPart(props: ScrapeErrorPartProps) { const location = useLocation(); const [extensionState, setExtensionState] = useState("unknown"); + const [extensionVersion, setExtensionVersion] = + useState("unknown"); const navigate = useNavigate(); const error = useMemo(() => { @@ -52,6 +58,9 @@ export function ScrapeErrorPart(props: ScrapeErrorPartProps) { getExtensionState().then((state: ExtensionStatus) => { setExtensionState(state); }); + getExtensionVersion().then((state: ExtensionVersion) => { + setExtensionVersion(state); + }); }, [t]); if (extensionState === "disallowed") { @@ -100,6 +109,49 @@ export function ScrapeErrorPart(props: ScrapeErrorPartProps) { ); } + // Ill do the rest later :shrug: + if (extensionVersion === ExtensionVersion.Version_1_1_5) { + + + + {t("player.scraping.extensionFailure.badge")} + + {t("player.scraping.extensionFailure.title")} + + , + }} + /> + +
+ + +
+
+
; + } + return ( diff --git a/src/utils/extension.ts b/src/utils/extension.ts index 8874146b..f958c63c 100644 --- a/src/utils/extension.ts +++ b/src/utils/extension.ts @@ -9,6 +9,11 @@ export type ExtensionStatus = | "outdated" | "success"; +export enum ExtensionVersion { + unknown = "unknown", + Version_1_1_5 = "1.1.5", +} + export async function getExtensionState(): Promise { const info = await extensionInfo(); if (!info) return "unknown"; // cant talk to extension @@ -18,3 +23,14 @@ export async function getExtensionState(): Promise { if (!isAllowedExtensionVersion(info.version)) return "outdated"; // extension is too old return "success"; // no problems } + +export async function getExtensionVersion(): Promise { + const info = await extensionInfo(); + if (!info || !info.success) return ExtensionVersion.unknown; // we dont know info + switch (info.version) { + case ExtensionVersion.Version_1_1_5: + return ExtensionVersion.Version_1_1_5; + default: + return ExtensionVersion.unknown; + } +}