We can then show the spinner only if there are 'many' games- I find the GameStore construction is by far the slower part of this, so we can avoid UI flicker this way.
The GameStore is built on a thread regardless, to minimize the chance of the infamous Death Waggle bug. It just looks smoother not to flash the spinner.
You can have a GOG game off the Lutris website that does not download from GOG - you provide the installer file. "Alient Shooter" is one of these.
In this case, we have no appid and can get no extras, and we should not try to get them.
If you click Continue fas enough, you can trigger the prepare_game_files() method to run twice, on two threads concurrently. This results in doubled up files and a duplicate files page in the navigation stack.
This is hard to fix simply or without UI ugliness, so this commit tolerates it.
It adjusts prepare_game_files() to be thread-safer (!) by committing its changes only at the end. The GIL should make this atomic, probably, so the last preparation wins instead of being combined with the other.
The navigation stack will now refuse to add a duplicate page; it still exits the old and re-enters but does not put the second entry in the history, so you'll go back further when you click the Back button.
That should hide the problem with minimal code churn and risk.
I'm not really sure that this code actually runs - there's dead code here for sure, and I can't prove we can ever match an existing game with an api-provided service installer.
Buuut if it does run it can crash us. We can't emi 'game-updated' on a thread, it absolutely hits GTK.
This commit moves the signal to the main thread and adds some error handling to avoid a NoneType error here too.
Super ugly this. Asyncio could do some much better!
Now here's a place where asyncio would clearly have helped.
But, the problem is that the move-game logic runs on a thread and changes the game. It saves the game and *that* fires the 'game-updated' signal. Various bits of the UI handle this to update the UI.
But GTK is not thread-safe at all, and updating the UI from a thread will sometimes crash it.
This commit suppresses the signal, and then manually fires it after the moe completes on the main thread in the AsyncCall callback.
These offer a non-functional 'Add to favorites' command. There are no actions that work on multiple service games, or mixes of service and library games.
This only works because we don't remove the column from existing databases, but we won't create it in new ones.
There's a bit of error handling so we silently skip the migration if the column's not there.
Also fix broken migration code, so migrations are applied with no init dialog.