Chore: Restructure Repository for SvelteKit

This commit is contained in:
Youwes09
2026-05-22 04:04:59 -05:00
parent bf071dcfc7
commit 8cef74bb98
266 changed files with 5093 additions and 396 deletions
+25
View File
@@ -0,0 +1,25 @@
import { getAdapter } from '$lib/request-manager'
import { downloadsState } from '$lib/state/downloads.svelte'
export async function loadDownloads() {
try {
downloadsState.items = await getAdapter().getDownloads()
} catch (e) {
downloadsState.error = String(e)
}
}
export async function enqueueDownload(chapterId: string) {
await getAdapter().enqueueDownload(chapterId)
await loadDownloads()
}
export async function dequeueDownload(chapterId: string) {
await getAdapter().dequeueDownload(chapterId)
downloadsState.items = downloadsState.items.filter(d => d.chapterId !== chapterId)
}
export async function clearDownloads() {
await getAdapter().clearDownloads()
downloadsState.items = []
}