Skip to content

Commit

Permalink
IGDB Game Search Results now contain a description.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 committed Feb 25, 2025
1 parent 673ae4f commit 9a0f6d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Changes

- [[#339](https://github.com/Phalcode/gamevault-backend/issues/339)] Added option to disable the landing page: **Set `SERVER_LANDING_PAGE_ENABLED` to false if you want to disable the landing page.**
- IGDB Game Search Results now contain a description.

### Thanks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ export class IgdbMetadataProviderService extends MetadataProvider {
const searchByName = await client
.request("games")
.pipe(
fields(["id", "name", "first_release_date", "cover.*"]),
fields([
"id",
"name",
"summary",
"storyline",
"first_release_date",
"cover.*",
]),
search(query),
whereIn("category", this.categoriesToInclude),
)
Expand All @@ -96,7 +103,14 @@ export class IgdbMetadataProviderService extends MetadataProvider {
const searchById = await client
.request("games")
.pipe(
fields(["id", "name", "first_release_date", "cover.*"]),
fields([
"id",
"name",
"summary",
"storyline",
"first_release_date",
"cover.*",
]),
where("id", "=", Number(query)),
)
.execute();
Expand Down Expand Up @@ -240,10 +254,7 @@ export class IgdbMetadataProviderService extends MetadataProvider {
provider_slug: "igdb",
provider_data_id: game.id?.toString(),
title: game.name,
description:
game.summary && game.storyline
? `${game.summary}\n\n${game.storyline}`
: game.summary || game.storyline || null,
description: game.summary || game.storyline || null,
release_date: new Date(game.first_release_date * 1000),
cover_url: this.replaceUrl(game.cover?.url, "t_thumb", "t_cover_big_2x"),
} as MinimalGameMetadataDto;
Expand Down

0 comments on commit 9a0f6d7

Please sign in to comment.