fix qodo stuff

This commit is contained in:
Duplicake-fyi 2026-02-22 20:38:16 +00:00
parent 29e53b4b39
commit 66c7a411c3
4 changed files with 22 additions and 241 deletions

View file

@ -306,11 +306,7 @@ export function LinksDropdown(props: { children: React.ReactNode }) {
{t("navigation.menu.desktop")}
</DropdownLink>
<DropdownLink
onClick={() => {
if ((window as any).__PSTREAM_OPEN_OFFLINE__) {
(window as any).__PSTREAM_OPEN_OFFLINE__();
}
}}
onClick={() => window.desktopApi?.openOffline()}
icon={Icons.DOWNLOAD}
>
Offline Downloads

View file

@ -90,25 +90,17 @@ export function DownloadView({ id }: { id: string }) {
}
}
window.postMessage(
{
name: "startDownload",
relayId: Math.random().toString(36).substring(7),
instanceId: "web-player",
body: {
url: downloadUrl,
title,
poster,
subtitleText,
duration,
type: sourceType,
},
},
"*",
);
window.desktopApi?.startDownload({
url: downloadUrl,
title,
poster,
subtitleText,
duration,
type: sourceType,
});
if ((window as any).__PSTREAM_OPEN_OFFLINE__) {
(window as any).__PSTREAM_OPEN_OFFLINE__();
if (window.desktopApi?.openOffline) {
window.desktopApi.openOffline();
} else {
router.navigate("/");
}

View file

@ -2,6 +2,17 @@
declare global {
interface Window {
__PSTREAM_DESKTOP__?: boolean;
desktopApi?: {
startDownload(data: {
url: string;
title: string;
poster?: string;
subtitleText?: string;
duration?: number;
type?: string;
}): void;
openOffline(): void;
};
}
}

File diff suppressed because one or more lines are too long