Many improvemtns and fixes related to decoupling of svelte and rust on android.
🏗️ Build and Test JellyTau / Run Tests (push) Failing after 18s
🏗️ Build and Test JellyTau / Build Android APK (push) Has been skipped
Traceability Validation / Check Requirement Traces (push) Failing after 2s

This commit is contained in:
2026-02-28 19:50:47 +01:00
parent 07f3bf04ca
commit e8e37649fa
53 changed files with 2309 additions and 792 deletions
@@ -1,6 +1,7 @@
<script lang="ts">
import { downloads } from "$lib/stores/downloads";
import { auth } from "$lib/stores/auth";
import { invoke } from "@tauri-apps/api/core";
import type { MediaItem } from "$lib/api/types";
interface Props {
@@ -82,9 +83,32 @@
}
}
} else {
// Download the album
// Download the album: queue all tracks, then start each one
const repo = auth.getRepository();
const basePath = `albums/${albumId}`;
await downloads.downloadAlbum(albumId, userId, basePath);
const downloadIds = await downloads.downloadAlbum(albumId, userId, basePath);
// Get target directory for downloads
const targetDir = await invoke<string>("storage_get_path");
// Start each queued track download
for (let i = 0; i < tracks.length && i < downloadIds.length; i++) {
try {
const streamUrl = await repo.getAudioStreamUrl(tracks[i].id);
if (streamUrl) {
await invoke("start_download", {
downloadId: downloadIds[i],
streamUrl,
targetDir,
});
}
} catch (e) {
console.error(`Failed to start download for track ${tracks[i].id}:`, e);
}
}
// Refresh to get updated statuses
await downloads.refresh(userId);
}
} catch (error) {
console.error("Album download operation failed:", error);