From 1c7bf4c51ff2177dfc7c07058e8a4b04b6a952f3 Mon Sep 17 00:00:00 2001 From: Alper Alkan Date: Fri, 25 Oct 2024 10:12:08 +0200 Subject: [PATCH] fix search --- .../providers/abstract.metadata-provider.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/metadata/providers/abstract.metadata-provider.service.ts b/src/modules/metadata/providers/abstract.metadata-provider.service.ts index 8bb8733..c9ffe05 100644 --- a/src/modules/metadata/providers/abstract.metadata-provider.service.ts +++ b/src/modules/metadata/providers/abstract.metadata-provider.service.ts @@ -128,7 +128,12 @@ export abstract class MetadataProvider implements OnModuleInit { game: GamevaultGame, ): Promise { // Search for the game using all available metadata providers but remove Edition Tags in the search. - const gameResults = await this.search(game.title.replace(/\[.*?\]/g, "")); + const gameResults = await this.search( + game.title + .replace(/\[.*?\]/g, "") + .replaceAll(" ", " ") + .trim(), + ); // If no matching games are found, throw an exception. if (gameResults.length === 0) {