Fix playtime no recording

After closing a game a TypeError `can only concatenate str (not "float") to str` was raised on uninitialized playtime.
This fix just forces playtime to be loaded as float instead of string.
This commit is contained in:
GoGo de Sica 2022-12-12 23:11:58 +01:00 committed by GitHub
parent 1fd2ff7292
commit d57d50c36f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,7 +93,7 @@ class Game(GObject.Object):
self.custom_images.add("coverart_big")
self.service = game_data.get("service")
self.appid = game_data.get("service_id")
self.playtime = game_data.get("playtime") or 0.0
self.playtime = float(game_data.get("playtime") or 0.0)
if self.game_config_id:
self.load_config()