mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-28 15:08:45 +00:00
fix qodo stuff
This commit is contained in:
parent
29e53b4b39
commit
66c7a411c3
4 changed files with 22 additions and 241 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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("/");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
Loading…
Reference in a new issue