From 7f9bf38da077674e2e5e285bc5ec778d764847a5 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Sun, 4 Dec 2022 11:45:04 +0100 Subject: [PATCH] Fix exception when no tags are provided. --- customiwmserver/data_types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/customiwmserver/data_types.py b/customiwmserver/data_types.py index 65c6905..9ac6567 100644 --- a/customiwmserver/data_types.py +++ b/customiwmserver/data_types.py @@ -64,7 +64,8 @@ class Notification(BaseModel): - `MapName`: `str`, displayed map name - `ByUserID`: `int`, who took the record - `ByUserName`: `str`, who took the record (displayed name) - - `NewTime`: `int`, might be the either the amount of seconds or the time id (TODO: correct the info) + - `NewTime`: `int`, Convertable to seconds using the following code: + `seconds = ((NewTime % 60000) / 100) * 2` - 1: Your time on was removed - Reason IDs: @@ -280,5 +281,6 @@ def convertTagsToNames(tags): global ids_to_names tagNames = [] for i in tags.split(","): - tagNames.append(ids_to_names[int(i)]) + if i.isdecimal(): + tagNames.append(ids_to_names[int(i)]) return tagNames