Skip to content

[GOG]: Switch to Galaxy way of loading library #2759

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

Merged
merged 8 commits into from
Jun 15, 2023
Merged

Conversation

imLinguin
Copy link
Member

@imLinguin imLinguin commented Jun 2, 2023

This is a test of trying to replicate how GOG Galaxy loads the library.

We achieve this using galaxy-library endpoint which contains games from all connected integrations (updated by client), and GOG (updated internally). We filter out all the gog games and use those.
If we decided to go hardcore we could maybe support those integrations in the future in some way.

Of course this can be further extended in terms of caching and deciding whether to fetch new data for games.

One proposition is to verify if we have up to date data when opening the game page.
For now I'm marking it as wip (library pagination is still to be done)

Additionally the galaxy-library endpoint provides us with certificates that somehow in pair with GOG access token allow us to get data from gamesdb that would return 404 otherwise.
Additionally I reduced IO traffic when pulling the library thanks to allowing to temporarily offload the CacheStore to memory, and then sync it to drive after all operations.

This PR also adds new field installable to GameInfo. Preventing Cannot get game info errors for goodie packs.

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

additionally added releveant types
@imLinguin imLinguin added the pr:wip WIP, don't merge. label Jun 2, 2023
imLinguin added 3 commits June 2, 2023 14:38
CacheStores now allow to enable temporal in-memory cache useful for many operations preventing IO blocking
@imLinguin
Copy link
Member Author

This PR also removes duplicated getGamesdbData function from wiki_game_info utils

imLinguin added 3 commits June 3, 2023 21:52
currently it's only used in GOG games that don't support any content system (goodies). If game couldn't be found in products API it's assumed it's not installable
@imLinguin imLinguin added pr:testing This PR is in testing, don't merge. pr:ready-for-review Feature-complete, ready for the grind! :P and removed pr:wip WIP, don't merge. labels Jun 8, 2023
@imLinguin imLinguin requested review from a team, arielj, flavioislima, CommandMC and Nocccer and removed request for a team June 8, 2023 22:03
@imLinguin
Copy link
Member Author

New not installable feature:

image

image
image

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks cool, will do some testing

@@ -133,6 +133,7 @@
},
"label": {
"game": {
"not-installable-game": "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a default text here.

@@ -80,7 +81,7 @@ export async function getExtraInfo(appName: string): Promise<ExtraInfo> {
const extra: ExtraInfo = {
about: gameInfo.extra?.about,
reqs: await createReqsArray(appName, targetPlatform),
storeUrl: gameInfo.store_url
storeUrl: (await getGamesData(appName))?._links.store.href
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this works, nice. But I still think that we should solve promises before defining the values of this object, for both this and the previous key.
It is more readable and safer imo.

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested here and everything looks good:

  • List games
  • Install
  • Launch
  • Uninstall

During the cache update, I got some missing/wrong information but then it updated it automatically after a few seconds. I think that is expected.

@flavioislima
Copy link
Member

@imLinguin I think this one is fine to merge if you want to.

@imLinguin
Copy link
Member Author

Oh, yes

@imLinguin imLinguin merged commit aa99e84 into main Jun 15, 2023
@imLinguin imLinguin deleted the feat/galaxy_library branch June 15, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P pr:testing This PR is in testing, don't merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants