From f34643f77c3d70c6bd46ee2e1fa63c4c24d6c043 Mon Sep 17 00:00:00 2001 From: Frisk Date: Tue, 17 Oct 2023 19:28:44 +0200 Subject: [PATCH] Add #270 --- src/rcgcdw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rcgcdw.py b/src/rcgcdw.py index 06ebcd9..281802e 100644 --- a/src/rcgcdw.py +++ b/src/rcgcdw.py @@ -147,7 +147,7 @@ def day_overview(client): if "actionhidden" in item or "suppressed" in item or "userhidden" in item: continue # while such actions have type value (edit/new/log) many other values are hidden and therefore can crash with key error, let's not process such events activity = add_to_dict(activity, item["user"]) - hours = add_to_dict(hours, datetime.datetime.strptime(item["timestamp"], "%Y-%m-%dT%H:%M:%SZ").hour) + hours = add_to_dict(hours, datetime.datetime.strptime(item["timestamp"], "%Y-%m-%dT%H:%M:%SZ").replace(minute=0, second=0, tzinfo=datetime.timezone.utc)) if item["type"] == "edit": edits += 1 changed_bytes += item["newlen"] - item["oldlen"] @@ -171,8 +171,8 @@ def day_overview(client): v = hours.values() active_hours = [] for hour, numberh in Counter(hours).most_common(list(v).count(max(v))): # find most active hours - active_hours.append(str(hour)) - houramount = ngettext(" UTC ({} action)", " UTC ({} actions)", numberh).format(numberh) + active_hours.append("") + houramount = ngettext(" ({} action)", " ({} actions)", numberh).format(numberh) else: active_users = active_hours = [_("But nobody came")] # a reference to my favorite game of all the time, sorry ^_^ usramount = houramount = ""