mirror of
https://github.com/lutris/lutris
synced 2024-09-15 22:09:55 +00:00
Also save playtime with lastplayed
This commit is contained in:
parent
18965f1e47
commit
395aa53fbf
|
@ -391,7 +391,12 @@ class Game(GObject.Object):
|
|||
def save_lastplayed(self):
|
||||
"""Save only the lastplayed field- do not restore any other values the user may have changed
|
||||
in another window."""
|
||||
games_db.update_existing(id=self.id, slug=self.slug, lastplayed=self.lastplayed)
|
||||
games_db.update_existing(
|
||||
id=self.id,
|
||||
slug=self.slug,
|
||||
lastplayed=self.lastplayed,
|
||||
playtime=self.playtime
|
||||
)
|
||||
self.emit("game-updated")
|
||||
|
||||
def check_launchable(self):
|
||||
|
@ -732,6 +737,7 @@ class Game(GObject.Object):
|
|||
if not self.timer.finished:
|
||||
self.timer.end()
|
||||
self.playtime += self.timer.duration / 3600
|
||||
logger.debug("Playtime: %s", self.formatted_playtime)
|
||||
|
||||
@watch_game_errors(game_stop_result=False)
|
||||
def beat(self):
|
||||
|
|
Loading…
Reference in a new issue