Skip to content

Commit

Permalink
fix: Fixed issue with new big numbers format on Blizzard stats. Updat…
Browse files Browse the repository at this point in the history
…ed heroes data. (#79)
  • Loading branch information
TeKrop committed Dec 5, 2023
1 parent 810e617 commit 5002fc0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/data/heroes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ junkrat,Junkrat,damage,200,0,0
kiriko,Kiriko,support,200,0,0
lifeweaver,Lifeweaver,support,175,0,50
lucio,Lúcio,support,200,0,0
mauga,Mauga,tank,650,0,0
mauga,Mauga,tank,350,150,0
mei,Mei,damage,250,0,0
mercy,Mercy,support,200,0,0
moira,Moira,support,200,0,0
orisa,Orisa,tank,275,275,0
pharah,Pharah,damage,200,0,0
ramattra,Ramattra,tank,450,0,0
ramattra,Ramattra,tank,200,100,0
reaper,Reaper,damage,250,0,0
reinhardt,Reinhardt,tank,350,250,0
roadhog,Roadhog,tank,700,0,0
Expand Down
4 changes: 2 additions & 2 deletions app/parsers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def get_computed_stat_value(input_str: str) -> str | float | int:
return int(result[1]) * 60 + int(result[2])

# Int format
if re.match(r"^-?\d+%?$", input_str):
return int(input_str.replace("%", ""))
if re.match(r"^-?\d+(,\d+)*%?$", input_str):
return int(input_str.replace("%", "").replace(",", ""))

# Float format
if re.match(r"^-?\d+\.\d+$", input_str):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "overfast-api"
version = "2.22.1"
version = "2.23.0"
description = "Overwatch API giving data about heroes, maps, and players statistics."
license = "MIT"
authors = ["Valentin PORCHET <valentin.porchet@proton.me>"]
Expand Down
4 changes: 2 additions & 2 deletions tests/parsers/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
("-86", -86),
("46%", 46),
("208", 208),
("12585", 12585),
("68236356", 68236356),
("12,585", 12585),
("68,236,356", 68236356),
# Float format
("7.58", 7.58),
("37.89", 37.89),
Expand Down

0 comments on commit 5002fc0

Please sign in to comment.