Skip to content

Commit

Permalink
Release 12.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 authored Jun 22, 2024
2 parents 2efebd5 + 00a9401 commit c8f7df4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# GameVault Backend Server Changelog

## 12.2.0

Recommended Gamevault App Version: `v1.11.0.0`

### Changes

- Fixed a bug where the indexer would break on password protected archives. [#297](https://github.com/Phalcode/gamevault-backend/issues/297)
- Added Ability to set a default password for game type detection. (`GAMES_DEFAULT_ARCHIVE_PASSWORD`)

### Thanks

- @casudo
- @Tere

## 12.1.3

Recommended Gamevault App Version: `v1.11.0.0`

### Changes

- Fixed a bug where Range header was not inclusive, like it should be according to its specification #298
- Fixed a bug where Range header was not inclusive, like it should be according to its specification [#298](https://github.com/Phalcode/gamevault-backend/issues/298)

### Thanks

- @Toylerr
- mjishnu
- @mjishnu

## 12.1.2

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gamevault-backend",
"version": "12.1.3",
"version": "12.2.0",
"description": "the self-hosted gaming platform for drm-free games",
"author": "Alkan Alper, Schäfer Philip GbR / Phalcode",
"private": true,
Expand Down
1 change: 1 addition & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const configuration = {
process.env.SEARCH_RECURSIVE,
true,
),
DEFAULT_ARCHIVE_PASSWORD: process.env.GAMES_DEFAULT_ARCHIVE_PASSWORD || "Anything",
} as const,
IMAGE: {
MAX_SIZE_IN_KB:
Expand Down
11 changes: 6 additions & 5 deletions src/modules/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,14 @@ export class FilesService implements OnApplicationBootstrap {
const listStream = list(path, {
recursive: true,
$cherryPick: matchers,
password: configuration.GAMES.DEFAULT_ARCHIVE_PASSWORD, // ANY Password is needed so it doesn't hang up
});

listStream.on("data", (data) => executablesList.push(data.file));

listStream.on("error", (error) => {
this.logger.error({
message: `Error extracting executables list. Archive could be corrupted.`,
message: `Error extracting executables list. The archive may be encrypted or corrupted.`,
game: { id: undefined, file_path: path },
error,
});
Expand Down Expand Up @@ -676,25 +677,25 @@ export class FilesService implements OnApplicationBootstrap {
): RangeHeader {
let rangeStart = 0;
let rangeEnd = fileSize - 1;

if (rangeHeader?.includes("-")) {
const [start, end] = rangeHeader.replace("bytes=", "").split("-");

if (start) {
const parsedStart = Number(start);
if (!isNaN(parsedStart) && parsedStart < fileSize) {
rangeStart = parsedStart;
}
}

if (end) {
const parsedEnd = Number(end);
if (!isNaN(parsedEnd) && parsedEnd < fileSize) {
rangeEnd = parsedEnd >= rangeStart ? parsedEnd : rangeEnd;
}
}
}

const rangeSize = rangeEnd - rangeStart + 1;
return {
start: rangeStart,
Expand Down

0 comments on commit c8f7df4

Please sign in to comment.