mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f9cfaa763 | ||
|
|
5d7f5b76ef |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "um-react",
|
||||
"private": true,
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
|
||||
@@ -10,6 +10,7 @@ export const workerParseMusicExMediaName = async ({ id, blobURI }: FetchMusicExN
|
||||
const blob = await timedLogger(`${label}/fetch-src`, async () =>
|
||||
fetch(blobURI, { headers: { Range: 'bytes=-1024' } }).then((r) => r.blob()),
|
||||
);
|
||||
|
||||
const buffer = await timedLogger(`${label}/read-src`, async () => {
|
||||
// Firefox: the range header does not work...?
|
||||
const blobBuffer = await blob.arrayBuffer();
|
||||
@@ -18,10 +19,12 @@ export const workerParseMusicExMediaName = async ({ id, blobURI }: FetchMusicExN
|
||||
}
|
||||
return blobBuffer;
|
||||
});
|
||||
|
||||
const parsed = makeQMCv2FooterParser(parakeet).parse(buffer);
|
||||
if (parsed.state === FooterParserState.OK) {
|
||||
return parsed.mediaName;
|
||||
}
|
||||
return '# N/A';
|
||||
|
||||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user