Browse Source

Remove iconv-lite calling

20230320
Yuki1536 2 years ago
parent
commit
105023def7
No known key found for this signature in database GPG Key ID: 86673EBBC510CD6C
  1. 8
      src/decrypt/ximalaya.ts

8
src/decrypt/ximalaya.ts

@ -1,6 +1,5 @@
import { parseBlob as metaParseBlob } from 'music-metadata-browser'; import { parseBlob as metaParseBlob } from 'music-metadata-browser';
import { AudioMimeType, SniffAudioExt, GetArrayBuffer, GetMetaFromFile } from "./utils"; import { AudioMimeType, SniffAudioExt, GetArrayBuffer, GetMetaFromFile } from "./utils";
import { decode } from 'iconv-lite';
import { DecryptResult } from '@/decrypt/entity'; import { DecryptResult } from '@/decrypt/entity';
interface Handler { interface Handler {
@ -24,13 +23,6 @@ export async function Decrypt(file: File, raw_filename: string, raw_ext: string)
let musicBlob = new Blob([musicDecoded], { type: mime }); let musicBlob = new Blob([musicDecoded], { type: mime });
const musicMeta = await metaParseBlob(musicBlob); const musicMeta = await metaParseBlob(musicBlob);
for (let metaIdx in musicMeta.native) {
if (musicMeta.native[metaIdx].some(item => item.id === "TCON" && item.value === "(12)")) {
musicMeta.common.artist = decode(musicMeta.common.artist, "gbk");
musicMeta.common.title = decode(musicMeta.common.title, "gbk");
musicMeta.common.album = decode(musicMeta.common.album, "gbk");
}
}
const info = GetMetaFromFile(raw_filename, musicMeta.common.title, musicMeta.common.artist); const info = GetMetaFromFile(raw_filename, musicMeta.common.title, musicMeta.common.artist);

Loading…
Cancel
Save