Fix exception when no tags are provided.

This commit is contained in:
magmaus3 2022-12-04 11:45:04 +01:00
parent d160d9b562
commit 7f9bf38da0
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251

View file

@ -64,7 +64,8 @@ class Notification(BaseModel):
- `MapName`: `str`, displayed map name - `MapName`: `str`, displayed map name
- `ByUserID`: `int`, who took the record - `ByUserID`: `int`, who took the record
- `ByUserName`: `str`, who took the record (displayed name) - `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 <map> was removed - 1: Your time on <map> was removed
- Reason IDs: - Reason IDs:
@ -280,5 +281,6 @@ def convertTagsToNames(tags):
global ids_to_names global ids_to_names
tagNames = [] tagNames = []
for i in tags.split(","): for i in tags.split(","):
if i.isdecimal():
tagNames.append(ids_to_names[int(i)]) tagNames.append(ids_to_names[int(i)])
return tagNames return tagNames