refactor(MIME): add getMimeTypeFromExt function

This commit is contained in:
awalol committed 2025-07-14 01:51:28 +08:00
1 parent fbe8ef8ba1
commit 13b67f40aa
2 files changed
+7 -3

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import { DecipherFactory, DecipherInstance, Status } from '~/decrypt-worker/Deci
import { UnsupportedSourceFile } from '~/decrypt-worker/util/DecryptError.ts';
import { ready as umCryptoReady } from '@unlock-music/crypto';
import { go } from '~/util/go.ts';
import { AudioMimeType, detectAudioExtension } from '~/decrypt-worker/util/audioType.ts';
import { getMimeTypeFromExt, detectAudioExtension } from '~/decrypt-worker/util/audioType.ts';
class DecryptCommandHandler {
private readonly label: string;
@@ -75,7 +75,7 @@ class DecryptCommandHandler {
audioExt = 'm4a';
}
return { decrypted: URL.createObjectURL(toBlob(result.data, AudioMimeType[audioExt])), ext: audioExt };
return { decrypted: URL.createObjectURL(toBlob(result.data, getMimeTypeFromExt(audioExt))), ext: audioExt };
}
}