Switch music-metadata to Blob-streaming, with slipping post-headers (#44)

Co-authored-by: Borewit <Borewit@users.noreply.github.com>
This commit is contained in:
Borewit 2025-03-12 21:37:51 +01:00 committed by GitHub
parent 3e821ebd63
commit 0e62d79a23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import { converters } from "$lib/converters";
import { error, log } from "$lib/logger";
import { VertFile } from "$lib/types";
import { parseBuffer, selectCover } from "music-metadata";
import { parseBlob, selectCover } from "music-metadata";
import { writable } from "svelte/store";
import { addDialog } from "./DialogProvider";
@ -33,7 +33,7 @@ class Files {
try {
if (isAudio) {
// try to get the thumbnail from the audio via music-metadata
const {common} = await parseBuffer(new Uint8Array(await file.file.arrayBuffer()));
const {common} = await parseBlob(file.file, {skipPostHeaders: true});
const cover = selectCover(common.picture);
if (cover) {
const blob = new Blob(