fix: queue now work for normal downloads

This commit is contained in:
Fredrik Burmester
2024-09-29 11:59:37 +02:00
parent b0f7cfd013
commit b6c6bac06a
4 changed files with 77 additions and 38 deletions

View File

@@ -164,6 +164,7 @@ export const DownloadItem: React.FC<DownloadProps> = ({ item, ...props }) => {
selectedAudioStream,
selectedSubtitleStream,
maxBitrate,
settings?.downloadMethod,
]);
/**
@@ -291,14 +292,17 @@ export const DownloadItem: React.FC<DownloadProps> = ({ item, ...props }) => {
throw new Error("No item id");
}
closeModal();
initiateDownload();
// Remove for now
// queueActions.enqueue(queue, setQueue, {
// id: item.Id,
// execute: async () => {
// },
// item,
// });
if (settings?.downloadMethod === "remux") {
queueActions.enqueue(queue, setQueue, {
id: item.Id,
execute: async () => {
await initiateDownload();
},
item,
});
} else {
initiateDownload();
}
} else {
toast.error("You are not allowed to download files.");
}

View File

@@ -48,7 +48,7 @@ export const ActiveDownloads: React.FC<Props> = ({ ...props }) => {
},
onError: (e) => {
console.log(e);
toast.error("Failed to cancel download");
toast.error("Failed to cancel download on the server");
},
});