Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat: add download cancellation functionality and external platform flag to course items
Tonhof3b2297fddaa
diff --git a/src/routes/courses/[platform]/+page.svelte b/src/routes/courses/[platform]/+page.svelteindex a7e29812..1f811c24 100644--- a/src/routes/courses/[platform]/+page.svelte+++ b/src/routes/courses/[platform]/+page.svelte@@ -334,7 +334,15 @@if (!config) return;const status = getDownloadStatus(item);if (status === "downloading") {- showToast("info", $t("toast.download_already_active"));+ if (config.commands.cancel) {+ try {+ const id = getItemId(item);+ await pluginInvoke("courses", config.commands.cancel, { courseId: id });+ showToast("info", "Download cancelled");+ } catch (e: any) {+ showToast("error", typeof e === "string" ? e : e.message ?? "Cancel failed");+ }+ }return;}if (status === "complete") return;@@ -479,6 +487,7 @@name={getItemName(item)}price={getItemSubtitle(item)}imageUrl={getItemImage(item)}+ externalPlatform={item.external_platform === true}downloadStatus={getDownloadStatus(item)}downloadPercent={getDownloadPercent(item)}onDownload={() => downloadItem(item)}