Fixed ontime round

This commit is contained in:
Sven Heidemann 2023-01-14 00:27:08 +01:00
parent 6dd9b9c302
commit 9658a5c238
15 changed files with 17 additions and 16 deletions

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -182,8 +182,9 @@ class ClientUtilsService(ClientUtilsABC):
return umcph.xp_count > settings.max_message_xp_per_hour return umcph.xp_count > settings.max_message_xp_per_hour
def get_ontime_for_user(self, user: User) -> float: def get_ontime_for_user(self, user: User) -> float:
return ( return round(
self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id) self._user_joined_voice_channel.get_user_joined_voice_channels_by_user_id(user.user_id)
.where(lambda x: x.leaved_on is not None and x.joined_on is not None) .where(lambda x: x.leaved_on is not None and x.joined_on is not None)
.sum(lambda join: round((join.leaved_on - join.joined_on).total_seconds() / 3600, 2)) .sum(lambda join: (join.leaved_on - join.joined_on).total_seconds() / 3600),
2,
) )

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "", "Author": "",
"AuthorEmail": "", "AuthorEmail": "",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "1"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",