mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-20 02:54:17 +01:00
wip
This commit is contained in:
@@ -25,6 +25,8 @@ export type OnProgressEventPayload = BaseEventPayload & {
|
|||||||
|
|
||||||
export type OnErrorEventPayload = BaseEventPayload & {
|
export type OnErrorEventPayload = BaseEventPayload & {
|
||||||
error: string;
|
error: string;
|
||||||
|
errorCode: number;
|
||||||
|
errorDomain: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OnCompleteEventPayload = BaseEventPayload & {
|
export type OnCompleteEventPayload = BaseEventPayload & {
|
||||||
|
|||||||
@@ -118,16 +118,17 @@ export const NativeDownloadProvider: React.FC<{
|
|||||||
console.log("Original download location:", payload.location);
|
console.log("Original download location:", payload.location);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the download info from our state
|
if (payload?.metadata?.Name) {
|
||||||
const downloadInfo = downloads[payload.id];
|
|
||||||
if (downloadInfo?.metadata?.Name) {
|
|
||||||
const newLocation = await persistDownloadedFile(
|
const newLocation = await persistDownloadedFile(
|
||||||
payload.location,
|
payload.location,
|
||||||
downloadInfo.metadata.Name
|
payload.metadata.Name
|
||||||
);
|
);
|
||||||
console.log("File successfully persisted to:", newLocation);
|
console.log("File successfully persisted to:", newLocation);
|
||||||
} else {
|
} else {
|
||||||
console.log("No filename in metadata, using original location");
|
console.log(
|
||||||
|
"No filename in metadata, using original location",
|
||||||
|
payload
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to persist file:", error);
|
console.error("Failed to persist file:", error);
|
||||||
|
|||||||
Reference in New Issue
Block a user