From e5c1e0ef4a1ed125a28336d5ce09be154dda2ea3 Mon Sep 17 00:00:00 2001 From: 283375 Date: Fri, 27 Oct 2023 00:23:17 +0800 Subject: [PATCH] fix(external): `fix_timestamp` digits counting (#3) --- src/arcaea_offline/external/arcaea/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arcaea_offline/external/arcaea/common.py b/src/arcaea_offline/external/arcaea/common.py index b0f328b..60e2b29 100644 --- a/src/arcaea_offline/external/arcaea/common.py +++ b/src/arcaea_offline/external/arcaea/common.py @@ -27,7 +27,7 @@ def fix_timestamp(timestamp: int) -> Union[int, None]: # but that's way too later than 9999-12-31 23:59:59, 253402271999, # I don't think Arcaea would still be an active updated game by then. # so don't mind those small issues, just use this. - digits = int(math.log10(timestamp)) + 1 + digits = int(math.log10(abs(timestamp))) + 1 if timestamp != 0 else 1 if digits < 5: return None timestamp_str = str(timestamp)