It really needs to be, or it's just useless - resulting in a UI error and potentially multiple threads syncing at once.
The problem is that _IS_LOCAL_LIBRARY_SYNCING is now a mutable global, and in Python this is treacherous. 'from x import G' copies G into scope, which is bad news for a global like this.
'import x' followed by 'x.G' works, but this is real dark corner, so I've added a global function just to read the global variable; it reads the original, not a copy, even if you copy the function reference into scope with 'from x import f'.
So this works without making LibrarySyncer a singleton.
The problem is that we often have .AppImage instead of the more Unixy .appimage, but the later occurs too.
So, We'll tolerate whatever CrAzY Casing you can come up with.
Resolves#5396
Ugly, but since we're fixing up the versions for the installer, we should do so for the game as well.
It's that or just insist that the game scripts all should be fixed to specify architecture for their wine versions.
This will just leave the list alone if 'Installed games only' is off and the filter text is empty.
Also, it no longer strips the filter text over and over again, but just once at the start. It still has to strip each game name, but it's half the strippings now.
Also, fix some ruff issues.
- Fixes the problem where the path ~/.local/share/ULWGL was the first path candidate which would cause lutris to run outdated files while the updated files pulled from the runtime would remain in the runtime directory. The current model expects clients to install ULWGL as a system package (e.g., flatpak, system package) and execute it.
- To ensure the ULWGL launcher and runtime files are synchronized or updated, this makes it so lutris never executes ulwgl_run.py in ~/.local/share/ULWGL and to instead prioritize the system package install then the lutris runtime directory.
This PR no longer uses SQL to search for games, but instead does it in Python.
However, the benefit is a more forgiving search. The game names and search text are normalized to form KD, and combining characters are extra whitespace are stripped.
This means that "The Signal From Tölva" can now be found by searching for "from Tolva".
This is a bit sloppy, and a bit "Do what I mean"- but even languages which consider 'ö' a distinct letter should be okay, since they surely won't have games that differ in their names only in that one letter. At least, not often.