Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat: add dependency store with ytdlp availability check and status management

Tonho7c8becf4059d
diff --git a/src/lib/stores/dependency-store.svelte.ts b/src/lib/stores/dependency-store.svelte.ts
new file mode 100644
index 00000000..13a645b1
--- /dev/null
+++ b/src/lib/stores/dependency-store.svelte.ts
@@ -0,0 +1,21 @@
+import { invoke } from "@tauri-apps/api/core";
+
+let ytdlpAvailable: boolean = $state(false);
+let checked: boolean = $state(false);
+
+export function isYtdlpAvailable(): boolean {
+ return ytdlpAvailable;
+}
+
+export function isDepsChecked(): boolean {
+ return checked;
+}
+
+export async function refreshYtdlpStatus(): Promise<void> {
+ try {
+ ytdlpAvailable = await invoke<boolean>("check_ytdlp_available");
+ } catch {
+ ytdlpAvailable = false;
+ }
+ checked = true;
+}