Fix 7z archives with spaces (#288)

* fix: ignore imported versions

* fix: bump droplet for 7z fixes
This commit is contained in:
DecDuck
2025-11-20 03:02:56 +00:00
committed by GitHub
parent beb824c8d9
commit 2ae7f41be0
8 changed files with 71 additions and 63 deletions

View File

@ -54,11 +54,15 @@ export class FilesystemProvider
return folderDirs;
}
async listVersions(game: string): Promise<string[]> {
async listVersions(
game: string,
ignoredVersions?: string[],
): Promise<string[]> {
const gameDir = path.join(this.config.baseDir, game);
if (!fs.existsSync(gameDir)) throw new GameNotFoundError();
const versionDirs = fs.readdirSync(gameDir);
const validVersionDirs = versionDirs.filter((e) => {
if (ignoredVersions && ignoredVersions.includes(e)) return false;
const fullDir = path.join(this.config.baseDir, game, e);
return DROPLET_HANDLER.hasBackendForPath(fullDir);
});
@ -109,17 +113,12 @@ export class FilesystemProvider
) {
const filepath = path.join(this.config.baseDir, game, version);
if (!fs.existsSync(filepath)) return undefined;
let stream;
while (!(stream instanceof ReadableStream)) {
const v = DROPLET_HANDLER.readFile(
filepath,
filename,
options?.start ? BigInt(options.start) : undefined,
options?.end ? BigInt(options.end) : undefined,
);
if (!v) return undefined;
stream = v.getStream() as ReadableStream<unknown>;
}
const stream = DROPLET_HANDLER.readFile(
filepath,
filename,
options?.start ? BigInt(options.start) : undefined,
options?.end ? BigInt(options.end) : undefined,
);
return stream;
}

View File

@ -112,7 +112,7 @@ export class FlatFilesystemProvider
);
if (!stream) return undefined;
return stream.getStream();
return stream;
}
fsStats() {