refactor: component/*.vue
This commit is contained in:
@@ -1,21 +1,11 @@
|
||||
import {Decrypt as NcmDecrypt} from "./ncm";
|
||||
import {Decrypt as XmDecrypt} from "./xm";
|
||||
import {Decrypt as QmcDecrypt} from "./qmc";
|
||||
import {Decrypt as KgmDecrypt} from "./kgm";
|
||||
import {Decrypt as NcmDecrypt} from "@/decrypt/ncm";
|
||||
import {Decrypt as XmDecrypt} from "@/decrypt/xm";
|
||||
import {Decrypt as QmcDecrypt} from "@/decrypt/qmc";
|
||||
import {Decrypt as KgmDecrypt} from "@/decrypt/kgm";
|
||||
import {Decrypt as KwmDecrypt} from "@/decrypt/kwm";
|
||||
import {Decrypt as RawDecrypt} from "@/decrypt/raw";
|
||||
import {Decrypt as TmDecrypt} from "@/decrypt/tm";
|
||||
import {DecryptResult} from "@/decrypt/entity";
|
||||
|
||||
|
||||
interface FileInfo {
|
||||
status: string
|
||||
name: string,
|
||||
size: number,
|
||||
percentage: number,
|
||||
uid: number,
|
||||
raw: File
|
||||
}
|
||||
import {DecryptResult, FileInfo} from "@/decrypt/entity";
|
||||
|
||||
|
||||
export async function CommonDecrypt(file: FileInfo): Promise<DecryptResult> {
|
||||
@@ -78,3 +68,4 @@ export async function CommonDecrypt(file: FileInfo): Promise<DecryptResult> {
|
||||
console.log(rt_data);
|
||||
return rt_data;
|
||||
}
|
||||
|
||||
|
@@ -14,3 +14,12 @@ export interface DecryptResult {
|
||||
rawFilename?: string
|
||||
|
||||
}
|
||||
|
||||
export interface FileInfo {
|
||||
status: string
|
||||
name: string,
|
||||
size: number,
|
||||
percentage: number,
|
||||
uid: number,
|
||||
raw: File
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ async function queryKeyInfo(keyData: Uint8Array, filename: string, format: strin
|
||||
let data = await resp.json();
|
||||
return new QmcMask(Base64Decode(data.Matrix44));
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ async function queryAlbumCoverImage(title: string, artist?: string, album?: stri
|
||||
return song_query_url + "/" + data.Type + "/" + data.Id
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.warn(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@@ -177,7 +177,6 @@ export function QmcMaskDetectMgg(data: Uint8Array) {
|
||||
|
||||
|
||||
function calcMaskFromConfidence(confidence: { [key: number]: number }) {
|
||||
console.log(confidence)
|
||||
const count = Object.keys(confidence).length
|
||||
if (count === 0) throw "can not match at least one key";
|
||||
if (count > 1) console.warn("There are 2 potential value for the mask!")
|
||||
|
@@ -42,7 +42,7 @@ export async function Decrypt(file: File, raw_filename: string, raw_ext: string)
|
||||
const musicMeta = await metaParseBlob(musicBlob);
|
||||
if (ext === "wav") {
|
||||
//todo:未知的编码方式
|
||||
console.log(musicMeta.common)
|
||||
console.info(musicMeta.common)
|
||||
musicMeta.common.album = "";
|
||||
musicMeta.common.artist = "";
|
||||
musicMeta.common.title = "";
|
||||
|
Reference in New Issue
Block a user