Description of problem: When using Lutris to launch programs, Last Played and Time Played do not work anymore. The most recent "Last Played" time on my system is from 2021 or so. Version-Release number of selected component (if applicable): Version : 0.5.8.4 Release : 1.mga8 How reproducible: Install Lutris. Install an application. Run the application. Stop the application. Note that neither Last Played or Time Played for that application updates. Steps to Reproduce: 1. Run "lutris" in a terminal. 2. Start an application from within lutris. 3. Stop the application. 4. Notice in the terminal: Traceback (most recent call last): File "/home/devel/lutris/lutris-0.5.10.1/lutris/game.py", line 665, in beat self.on_game_quit() File "/home/devel/lutris/lutris-0.5.10.1/lutris/game.py", line 691, in on_game_quit self.stop() File "/home/devel/lutris/lutris-0.5.10.1/lutris/game.py", line 679, in stop self.stop_game() File "/home/devel/lutris/lutris-0.5.10.1/lutris/game.py", line 639, in stop_game self.playtime += self.timer.duration / 3600 TypeError: can only concatenate str (not "float") to str This problem exists upstream, and is even present in the latest github release (5.10.1). I have filed a bug report here: https://github.com/lutris/lutris/issues/4289 Regardless, the following fixes the issue in the current Mageia release: --- /usr/lib/python3.8/site-packages/lutris/game.py.orig 2021-07-02 20:01:47.000000000 -0500 +++ /usr/lib/python3.8/site-packages/lutris/game.py 2022-05-19 10:10:51.971704905 -0500 @@ -511,7 +511,7 @@ self.emit("game-stop") if not self.timer.finished: self.timer.end() - self.playtime += self.timer.duration / 3600 + self.playtime += str(self.timer.duration / 3600) def prelaunch_beat(self): """Watch the prelaunch command"""
Sorry, wrong patch above. The correct patch is: 1:47.000000000 -0500 +++ /usr/lib/python3.8/site-packages/lutris/game.py 2022-05-19 12:19:00.658956942 -0500 @@ -511,7 +511,7 @@ self.emit("game-stop") if not self.timer.finished: self.timer.end() - self.playtime += self.timer.duration / 3600 + self.playtime = str(float(self.playtime) + self.timer.duration / 3600) def prelaunch_beat(self): """Watch the prelaunch command"""
Apparently I have trouble copy/pasting, but the patch is still readable. In any event, in and expansion of the upstream source tarball, the fix goes into the lutris/game.py file. Be aware the current upstream release (0.5.10.1) also has the bug, but I have tested this patch on both the upstream release and in the current Mageia 8 package.
Version: Cauldron => 8
CC: (none) => kbulgrien
This would affect Cauldron as well, since the bug is still present in the upstream top-of-tree and has been there for (3) years: https://github.com/lutris/lutris/blob/master/lutris/game.py https://github.com/lutris/lutris/commit/68d7fade47a21968f947c5403f5aa6bc46942b12
The actual regression occurs here on Jan 19, 2019: https://github.com/lutris/lutris/commit/d3ee298ef387cfc300b000d5d3359ae781e2dee2
Thank you for the fulsome report: not just the fault, but the upstream bug, and your own correction (comment 1, comment 2) - which presumably they will apply. lutris is looked after by Rémi, so assiging this to you.
Whiteboard: (none) => MGA8TOOVersion: 8 => CauldronAssignee: bugsquad => rverschelde