mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
chore: reformat project
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import {
|
||||
ParseKugouHeaderPayload, ParseKugouHeaderResponse,
|
||||
|
||||
} from '~/decrypt-worker/types.ts';
|
||||
import { ParseKugouHeaderPayload, ParseKugouHeaderResponse } from '~/decrypt-worker/types.ts';
|
||||
import { KuGouHeader } from '@unlock-music/crypto';
|
||||
|
||||
export const workerParseKugouHeader = async ({ blobURI }: ParseKugouHeaderPayload): Promise<ParseKugouHeaderResponse> => {
|
||||
export const workerParseKugouHeader = async ({
|
||||
blobURI,
|
||||
}: ParseKugouHeaderPayload): Promise<ParseKugouHeaderResponse> => {
|
||||
const blob = await fetch(blobURI, { headers: { Range: 'bytes=0-1023' } }).then((r) => r.blob());
|
||||
const arrayBuffer = await blob.arrayBuffer();
|
||||
const buffer = new Uint8Array(arrayBuffer.slice(0, 0x400));
|
||||
|
||||
let kwm : KuGouHeader | undefined;
|
||||
let kwm: KuGouHeader | undefined;
|
||||
|
||||
try {
|
||||
kwm = new KuGouHeader(buffer);
|
||||
@@ -20,4 +19,4 @@ export const workerParseKugouHeader = async ({ blobURI }: ParseKugouHeaderPayloa
|
||||
} finally {
|
||||
kwm?.free();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ParseKuwoHeaderPayload, ParseKuwoHeaderResponse } from '~/decrypt-worker/types.ts';
|
||||
import { ParseKuwoHeaderPayload, ParseKuwoHeaderResponse } from '~/decrypt-worker/types.ts';
|
||||
import { KuwoHeader } from '@unlock-music/crypto';
|
||||
|
||||
export const workerParseKuwoHeader = async ({ blobURI }: ParseKuwoHeaderPayload): Promise<ParseKuwoHeaderResponse> => {
|
||||
|
||||
@@ -5,7 +5,10 @@ import { ConcurrentQueue } from './ConcurrentQueue';
|
||||
import { WorkerClientBus } from './WorkerEventBus';
|
||||
|
||||
export class DecryptionQueue extends ConcurrentQueue<DecryptCommandPayload, DecryptionResult> {
|
||||
constructor(private workerClientBus: WorkerClientBus<DECRYPTION_WORKER_ACTION_NAME>, maxQueue?: number) {
|
||||
constructor(
|
||||
private workerClientBus: WorkerClientBus<DECRYPTION_WORKER_ACTION_NAME>,
|
||||
maxQueue?: number,
|
||||
) {
|
||||
super(maxQueue);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ const nextTickFn =
|
||||
typeof setImmediate !== 'undefined'
|
||||
? (setImmediate as NextTickFn)
|
||||
: typeof requestAnimationFrame !== 'undefined'
|
||||
? (requestAnimationFrame as NextTickFn)
|
||||
: (setTimeout as NextTickFn);
|
||||
? (requestAnimationFrame as NextTickFn)
|
||||
: (setTimeout as NextTickFn);
|
||||
/* c8 ignore stop */
|
||||
|
||||
export async function nextTickAsync() {
|
||||
|
||||
Reference in New Issue
Block a user