sharkwouter / minigalaxy

A simple GOG client for Linux
https://sharkwouter.github.io/minigalaxy/
GNU General Public License v3.0
1.09k stars 70 forks source link

Game list order changes after fetching games list from the API #564

Open LeXofLeviafan opened 1 year ago

LeXofLeviafan commented 1 year ago

A few months ago I've installed several games from the DROD series. I haven't been playing them for a while, but after I started I've noticed that the order they're placed in initially gets changed after a few seconds. This causes usage problems; i.e. if I'm trying to run a game, I click "play" on one of the games, but it switches out the game tile under my cursor so a different game loads up instead.

It seems that the name was changed in the API for some games since I've installed them; so the initial order they're placed in goes like this:

DROD RPG: Tendry's Tale
DROD: Gunthro and the Epic Blunder
DROD: Journey to Rooted Hold
DROD: King Dugan's Dungeon
DROD: The City Beneath
DROD: The Second Sky

…and after fetching API data they get ordered like this:

DROD 2: Journey to Rooted Hold
DROD 3: The City Beneath
DROD 4: Gunthro and the Epic Blunder
DROD RPG: Tendry's Tale
DROD: King Dugan's Dungeon
DROD: The Second Sky

The first version of the name appears to be taken from the ./gameinfo file contained in the game folder. I suggest detecting when the name fetched in the API differs from the old one, and updating the metadata file so that the initial tile ordering is correct on the next startup.

sharkwouter commented 1 year ago

That is odd. When did you install them? If they were installed with the latest version of Minigalaxy, this should not happen, but it would be good to test that. If you reinstall one or two of them, does that change the behavior for these specific ones?

LeXofLeviafan commented 1 year ago

…Like I said: the initial ordering is controlled by the contents of ./gameinfo, and GOG can change the name in the API at any time; so if the name in the API was changed after the game was installed, Minigalaxy doesn't update the respective ./gameinfo file, thus causing discrepancy in the sorting order.

And yes, I'm running the latest release (1.2.2).

LeXofLeviafan commented 1 year ago

As for your question: reinstalling the game does not help – after the game is installed, the ./gameinfo contains the old name (not the one from the API). Perhaps it's taken from the installer instead? Although it hardly matters – updating the name at install time only wouldn't prevent the issue from resurfacing once an already installed game has its name changed in the API.

(Also the tile is still dimmed after the install, and the sorting position isn't moved into the installed games list… until the app restart, that is.)

sharkwouter commented 1 year ago

Oh, that makes sense. So what you're saying is that the name in the gameinfo file should be updated when the api is polled. Got it.