-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Lutris Games List Crashes if Game Has No Runner, Install Location, or Installation Time #397
Comments
I noticed I left a comment in in https://github.com/davidotek/ProtonUp-Qt/blob/main/pupgui2/pupgui2gamelistdialog.py#L215 So maybe the only other problematic element was https://github.com/davidotek/ProtonUp-Qt/blob/main/pupgui2/pupgui2gamelistdialog.py#L219-L226 It falls over when trying to perform all of those date operations and splits on So we could go with just skipping of Or we could remove the |
We should always ensure that the variables in
Sounds reasonable. We probably should also filter out games with no install directory then. |
Funny, I've been looking into Rust the last couple of days out of interest 😄
Yup, that's what I was trying to get at but put more clearly. At least that's my assumption, a "correct" game or at least correct in terms of being valid to display on the Games List, should contain at minimum a Past sonic2kk noted in If it is still missing after this, we set Relevant part of the code: ProtonUp-Qt/pupgui2/lutrisutil.py Lines 34 to 46 in 0eecd90
Games cannot be missing a I did a bit of digging on I did a quick-and-dirty query of the DB: Games with I used the following query to check information about games with no So it seems to me that, excluding Steam games (which we don't display on the Games List),
To check the slugs, I used the following:
So in short, all games should have a Reference for all queries in a friendly code block with comments. For transparency I used "DB Browser for SQLite", I found it a bit cumbersome to use but I had it installed probably from a long time ago 😄 Slug Queries-- Check games without slug (for me, returns zero records)
SELECT slug, name, runner, directory, installed_at
FROM games
WHERE slug IS NULL
-- First query gets all games with non-null slug, second query just fetches all games
-- Both queries should return the same amount of rows
SELECT slug, name, runner, directory, installed_at
FROM games
WHERE slug NOT NULL
SELECT slug, name, runner, directory, installed_at
FROM games
|
Describe the bug
What the problem is: When viewing the Games List for Lutris, if there is a game with no runner, it will crash because we attempt to run
capitalize()
on the runner name to display it. Even if we try to skip games that havegame.runner == None
or infer a game's runner based on the Lutris config file (if a Lutris config hasgame.appid
then we can assume it's a Steam game), we run into problems where we're missing other information likegame.install_dir
andgame.installed_at
.What causes the problem: Valid games should always have a runner, but Lutris will store uninstalled Steam games in its sqlite DB. So if you link your Steam library to Lutris, uninstalled Steam games will be there but they will be missing a
runner
,install_dir
,installed_at
, and I believe aslug
.When did this start: I am not sure if Lutris always stored Steam games like this. Attempting to sync my games list always caused Lutris to crash, but at the same time I don't remember it missing any games. So I think this might be new behaviour that it stores these games in its DB.
Possible solutions:
PupguiGameListDialog
to do this, and we can call it when we're generating the Lutris game list:ProtonUp-Qt/pupgui2/pupgui2gamelistdialog.py
Line 183 in db33194
In this case I have found the issue of all these missing fields only being applicable for not-installed Steam games that are in my library, but it could theoretically happen for any other game using any runner. That said, in my head it's equally valid to assume any game from any runner is invalid if it's missing all of this data (invalid meaning, not relevant to display on the Game List).
I have already prototyped a patch based on Solution 1, creating a
PupguiGameListDialog#is_valid_lutris_gameslist_game
method that returns False ifgame.runner
,game.install_dir
, ORgame.installed_at
are Falsey, as well as if the current runner issteam
. In my mind, based on the issue as I have encountered it now, a game missing arunner
shouldn't be displayed on the Games List. Then, if a game doesn't have a known install location, we probably want to skip it too. Installation time is one I'm a bit on the fence about. if it's missing it'll cause a crash right now but we could easily fix this by doing a check forgame.installed_at == None
and displaying "Unknown" on this column (and skipping the tooltip building logic). We already do a check to display the install_dir as "Unknown" if it's Falsey but maybe it's best to skip it altogether. Implementation detail is probably something we can discuss separately 😄I'm opening this issue to get a bit of discussion going on the problem, to make sure I've put across what the problem is properly as it took me a little while to figure out the issue, and also to discuss the solution in case there's a better approach.
But regardless of where we land I'm happy to be the one to tackle this :-)
In short, uninstalled Steam games can be in the Lutris DB file, and these are missing a bunch of information. Even though we filter out Steam games, they're missing a runner to do this filtering. We can make some assumptions to add this runner, but even then these games are missing a lot of information. And while this issue I have found is isolated to not-installed Steam games being missing this data, games from other runners could also be missing this information for any other reason, but it is likely just as relevant to ignore those games. If any game is missing this data we probably don't want to display it on the Games List, it just happens that for the purposes of this issue, I have only found this with uninstalled Steam games.
To Reproduce
~/.local/share/lutris/pga.db
). For context, mine was around 1mb.~/.local/share/lutris/pga.db
). My DB size increased by around 1.2mb, and now includes uninstalled Steam games.capitalize()
onExpected behavior
Avoid this crash by handling games that are missing this data.
Screenshots
The following backtrace is shown in the error dialog:
Desktop (please complete the following information):
python3 -m pupgui2
Additional context
Not sure if this affects the CtInfo dialog. I think it probably wouldn't since it should rely on a runner being present in the first place and would skip if no runner is present? At least I haven't ran into any issues with the CtInfo dialog.
Terminal output
The following backtrace is printed, and also shows up in the error dialog.
The text was updated successfully, but these errors were encountered: