-
Notifications
You must be signed in to change notification settings - Fork 20
improve igdb metadata fetching #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Make sure to get images with reasonable resolution.
By default the url igdb returns is in "t_thumb" size,
an image of size 90x90, which is good only for the icon,
but bad for pretty much else. This commit will make sure
covers will be of size "t_cover_big", artworks of 1080p
height (i.e. "t_1080p") and logos will have their original
size ("t_original"). Maybe "t_logo_med" is more appropriate?
* Fetch screenshots as well.
* Use a separate image for icon and for cover.
icon needs to be a square, and can be of low
resolution, so the "t_thmb" size is more appropriate
for him.
* If there is a storyline for a game use it as a short
description.
| const images = [icon]; | ||
| const images = [coverID]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to include the icon in the images array as that's meant to include every imagine iirc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not included in the other metadata fetchers :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If icon isn't used anywhere then can you remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in the return value of fetchgame(), but it is not part of the images array. The icons are used in the side menu of the library page

and as a browser tab icon in a game page inside the store

If the icon was part of the images array it would appear together with the other images as an option to add it to carousel, which is not very useful IMO.
server/internal/metadata/igdb.ts
Outdated
| id: currentGame.id.toString(), | ||
| name: currentGame.name, | ||
| shortDescription: deck, | ||
| shortDescription: currentGame.storyline ?? deck, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is storyline more likely to be a shorter block of text? Also can you give a quick example of it for a game?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, in the examples I checked originally the storyline is about the same length, although a bit shorter:
- https://www.igdb.com/games/hollow-knight-silksong
- https://www.igdb.com/games/celeste
- https://www.igdb.com/games/the-witcher-3-wild-hunt
- https://www.igdb.com/games/minecraft-java-edition
but then:
and arguably in the last two examples the text is not really a story. Given the large content of the story in the last example, maybe a test to see which is shorter should be done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It honestly seems like both the story and description are equally bad options for a short explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a better idea than checking which one is longer and trimming to make sure the description is not too long. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe?? Since the api call gets both, why not compare their lengths and use the shortest one?
|
@Huskydog9988 is this okay to merge? |
|
I haven't had time to test this, but assuming it works I'm fine with it. |
Make sure to get images with reasonable resolution. By default the url igdb returns is in "t_thumb" size, an image of size 90x90, which is good only for the icon, but bad for pretty much else. This commit will make sure covers will be of size "t_cover_big", artworks of 1080p height (i.e. "t_1080p") and logos will have their original size ("t_original"). Maybe "t_logo_med" is more appropriate?
Fetch screenshots as well.
Use a separate image for icon and for cover. icon needs to be a square, and can be of low resolution, so the "t_thmb" size is more appropriate for him.
If there is a storyline for a game use it as a short description.