Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

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

Borewit0e62d79a2328
diff --git a/src/lib/store/index.svelte.ts b/src/lib/store/index.svelte.ts
index 53675cb..dc4e63b 100644
--- a/src/lib/store/index.svelte.ts
+++ b/src/lib/store/index.svelte.ts
@@ -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(