mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-11 17:55: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 captionList = usePlayerStore((s) => s.captionList);
|
||||||
const meta = usePlayerStore((s) => s.meta);
|
const meta = usePlayerStore((s) => s.meta);
|
||||||
const duration = usePlayerStore((s) => s.progress.duration);
|
const duration = usePlayerStore((s) => s.progress.duration);
|
||||||
|
const source = usePlayerStore((s) => s.source);
|
||||||
const isDesktopApp = useIsDesktopApp();
|
const isDesktopApp = useIsDesktopApp();
|
||||||
|
|
||||||
const startOfflineDownload = useCallback(async () => {
|
const startOfflineDownload = useCallback(async () => {
|
||||||
|
|
@ -97,6 +98,11 @@ export function DownloadView({ id }: { id: string }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const headers = {
|
||||||
|
...(source?.headers ?? {}),
|
||||||
|
...(source?.preferredHeaders ?? {}),
|
||||||
|
};
|
||||||
|
|
||||||
window.desktopApi?.startDownload({
|
window.desktopApi?.startDownload({
|
||||||
url: downloadUrl,
|
url: downloadUrl,
|
||||||
title,
|
title,
|
||||||
|
|
@ -104,6 +110,7 @@ export function DownloadView({ id }: { id: string }) {
|
||||||
subtitleText,
|
subtitleText,
|
||||||
duration,
|
duration,
|
||||||
type: sourceType,
|
type: sourceType,
|
||||||
|
headers,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.desktopApi?.openOffline) {
|
if (window.desktopApi?.openOffline) {
|
||||||
|
|
@ -118,6 +125,7 @@ export function DownloadView({ id }: { id: string }) {
|
||||||
captionList,
|
captionList,
|
||||||
duration,
|
duration,
|
||||||
router,
|
router,
|
||||||
|
source,
|
||||||
sourceType,
|
sourceType,
|
||||||
t,
|
t,
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ declare global {
|
||||||
subtitleText?: string;
|
subtitleText?: string;
|
||||||
duration?: number;
|
duration?: number;
|
||||||
type?: string;
|
type?: string;
|
||||||
|
headers?: Record<string, string>;
|
||||||
}): void;
|
}): void;
|
||||||
openOffline(): void;
|
openOffline(): void;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue