|
|
|
@ -10,8 +10,15 @@ import { Decrypt as TmDecrypt } from '@/decrypt/tm';
|
|
|
|
|
import { Decrypt as JooxDecrypt } from '@/decrypt/joox';
|
|
|
|
|
import { DecryptResult, FileInfo } from '@/decrypt/entity';
|
|
|
|
|
import { SplitFilename } from '@/decrypt/utils';
|
|
|
|
|
import { storage } from '@/utils/storage';
|
|
|
|
|
import InMemoryStorage from '@/utils/storage/InMemoryStorage';
|
|
|
|
|
|
|
|
|
|
export async function CommonDecrypt(file: FileInfo, config: Record<string, any>): Promise<DecryptResult> {
|
|
|
|
|
// Worker thread will fallback to in-memory storage.
|
|
|
|
|
if (storage instanceof InMemoryStorage) {
|
|
|
|
|
await storage.setAll(config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function CommonDecrypt(file: FileInfo): Promise<DecryptResult> {
|
|
|
|
|
const raw = SplitFilename(file.name);
|
|
|
|
|
let rt_data: DecryptResult;
|
|
|
|
|
switch (raw.ext) {
|
|
|
|
|