Skip to content

Commit

Permalink
Release 10.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 authored Dec 24, 2023
2 parents 66baf5c + 3c85f8e commit 3cf0a59
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# GameVault Backend Server Changelog

## 10.0.1

### Changes

- Fixed Server detecting invalid file names for games in subdirectories

### Thanks

- @Kudjo

## 10.0.0

Recommended Gamevault App Version: `v1.8.0`
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": "10.0.0",
"version": "10.0.1",
"description": "the self-hosted gaming platform for drm-free games",
"author": "Alkan Alper, Schäfer Philip GbR / Phalcode",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/files/files.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe("FilesService", () => {
const validFilenames = [
"Star Wars Jedi - Fallen Order (v1.0.10.0) (2019).zip",
"HITMAN 3 (v3.10.1) (2021).7z",
"The Wandering Village (v0.1.32) (EA) (2022).iso",
"!mygames/!The Wandering Village (v0.1.32) (EA) (2022).iso",
"Saints Row (W_S) (2022).zip",
"My personal IndieGame (v1.2.9) (NC) (2018).zip",
"Stray (2022).7z",
Expand Down
8 changes: 5 additions & 3 deletions src/modules/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class FilesService implements OnApplicationBootstrap {
private gamesService: GamesService,
private rawgService: RawgService,
private boxartService: BoxArtsService,
) {}
) { }

onApplicationBootstrap() {
this.checkFolders();
Expand Down Expand Up @@ -158,10 +158,11 @@ export class FilesService implements OnApplicationBootstrap {

private isValidFilename(filename: string) {
const invalidCharacters = /[\/<>:"\\|?*]/;
const actualFilename = basename(filename);

if (
!configuration.GAMES.SUPPORTED_FILE_FORMATS.includes(
extname(filename).toLowerCase(),
extname(actualFilename).toLowerCase(),
)
) {
this.logger.debug(
Expand All @@ -170,7 +171,7 @@ export class FilesService implements OnApplicationBootstrap {
return false;
}

if (invalidCharacters.test(filename)) {
if (invalidCharacters.test(actualFilename)) {
this.logger.warn(
`Indexer ignoring invalid filename: contains invalid characters - ${filename}`,
);
Expand All @@ -180,6 +181,7 @@ export class FilesService implements OnApplicationBootstrap {
return true;
}


/**
* This method extracts the game title from a given file name string using a
* regular expression.
Expand Down

0 comments on commit 3cf0a59

Please sign in to comment.