CODEX - More changes to the binary files, listing and storing

This commit is contained in:
2026-02-23 13:58:40 +02:00
parent d390bdac0d
commit 04b2a0bcb8
5 changed files with 154 additions and 22 deletions

View File

@@ -557,11 +557,12 @@ export default function MelodyDetail() {
const handleDownload = async (e) => {
e.preventDefault();
const preferredUrl = melody?.id ? `/api/melodies/${melody.id}/download/binary` : binaryUrl;
try {
const token = localStorage.getItem("access_token");
let res = null;
try {
res = await fetch(binaryUrl, {
res = await fetch(preferredUrl, {
headers: token ? { Authorization: `Bearer ${token}` } : {},
});
} catch {