Group zip extensions better
Some checks are pending
Tests / tests (push) Waiting to run

This commit is contained in:
Dustin Brett
2025-02-08 09:29:39 -08:00
parent 431da127f5
commit 8acad146c4
4 changed files with 7 additions and 4 deletions

View File

@@ -38,7 +38,6 @@ export const EXTRACTABLE_EXTENSIONS = new Set([
".odt",
".ova",
".pages",
".pk3",
".pkg",
".ppt",
".qcow",

View File

@@ -38,6 +38,7 @@ import {
SHORTCUT_APPEND,
SHORTCUT_EXTENSION,
SYSTEM_SHORTCUT_DIRECTORIES,
ZIP_EXTENSIONS,
} from "utils/constants";
import {
bufferToUrl,
@@ -493,7 +494,7 @@ const useFolder = (
try {
const unzippedFiles = Object.entries(
[".jsdos", ".wsz", ".zip"].includes(getExtension(path))
ZIP_EXTENSIONS.has(getExtension(path))
? await unzip(data)
: await unarchive(path, data)
);

View File

@@ -164,7 +164,9 @@ export const MILLISECONDS_IN_MINUTE = 60000;
export const MILLISECONDS_IN_DAY = 86400000;
export const MOUNTABLE_EXTENSIONS = new Set([".iso", ".jsdos", ".wsz", ".zip"]);
export const ZIP_EXTENSIONS = new Set([".jsdos", ".pk3", ".wsz", ".zip"]);
export const MOUNTABLE_EXTENSIONS = new Set([".iso", ...ZIP_EXTENSIONS]);
export const SPREADSHEET_FORMATS = [
".csv",

View File

@@ -858,8 +858,9 @@ export const getMimeType = (url: string, ext?: string): string => {
return "image/webp";
case ".xml":
return "application/xml";
case ".wsz":
case ".jsdos":
case ".pk3":
case ".wsz":
case ".zip":
return "application/zip";
default: