Fixed time calculation for user joined gs/vs

This commit is contained in:
Sven Heidemann 2023-03-05 22:32:20 +01:00
parent bddcd3929a
commit 1664c67763
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,8 @@ class UserJoinedGameServer(TableABC):
@property @property
def time(self) -> float: def time(self) -> float:
if self._leaved_on is None or self._joined_on is None:
return 0
return round((self.leaved_on - self.joined_on).total_seconds() / 3600, 2) return round((self.leaved_on - self.joined_on).total_seconds() / 3600, 2)
@property @property

View File

@ -47,6 +47,8 @@ class UserJoinedVoiceChannel(TableABC):
@property @property
def time(self) -> float: def time(self) -> float:
if self._leaved_on is None or self._joined_on is None:
return 0
return round((self.leaved_on - self.joined_on).total_seconds() / 3600, 2) return round((self.leaved_on - self.joined_on).total_seconds() / 3600, 2)
@property @property