mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-11 09:45:33 +00:00
pass headers to app
This commit is contained in:
parent
3507db4050
commit
c9c40a12e6
2 changed files with 9 additions and 0 deletions
|
|
@ -76,6 +76,7 @@ export function DownloadView({ id }: { id: string }) {
|
|||
const captionList = usePlayerStore((s) => s.captionList);
|
||||
const meta = usePlayerStore((s) => s.meta);
|
||||
const duration = usePlayerStore((s) => s.progress.duration);
|
||||
const source = usePlayerStore((s) => s.source);
|
||||
const isDesktopApp = useIsDesktopApp();
|
||||
|
||||
const startOfflineDownload = useCallback(async () => {
|
||||
|
|
@ -97,6 +98,11 @@ export function DownloadView({ id }: { id: string }) {
|
|||
}
|
||||
}
|
||||
|
||||
const headers = {
|
||||
...(source?.headers ?? {}),
|
||||
...(source?.preferredHeaders ?? {}),
|
||||
};
|
||||
|
||||
window.desktopApi?.startDownload({
|
||||
url: downloadUrl,
|
||||
title,
|
||||
|
|
@ -104,6 +110,7 @@ export function DownloadView({ id }: { id: string }) {
|
|||
subtitleText,
|
||||
duration,
|
||||
type: sourceType,
|
||||
headers,
|
||||
});
|
||||
|
||||
if (window.desktopApi?.openOffline) {
|
||||
|
|
@ -118,6 +125,7 @@ export function DownloadView({ id }: { id: string }) {
|
|||
captionList,
|
||||
duration,
|
||||
router,
|
||||
source,
|
||||
sourceType,
|
||||
t,
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ declare global {
|
|||
subtitleText?: string;
|
||||
duration?: number;
|
||||
type?: string;
|
||||
headers?: Record<string, string>;
|
||||
}): void;
|
||||
openOffline(): void;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue