From 5fbbd4431367a2e87280f8d84a6628fed47a45a4 Mon Sep 17 00:00:00 2001 From: extreme4all <40169115+extreme4all@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:54:41 +0200 Subject: [PATCH] bugfix --- api/cogs/requests.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/api/cogs/requests.py b/api/cogs/requests.py index 297e48c..cee1b44 100644 --- a/api/cogs/requests.py +++ b/api/cogs/requests.py @@ -108,17 +108,14 @@ async def get_player_data(label_id: int, limit: int = 5000): def parse_hs_data(data: list[ScraperDataV3]) -> list[HighscoreData]: hiscores = [] for d in data: - scraper_data = ScraperDataV3(**d) - skills = {r.skill_name: r.skill_value for r in scraper_data.skills} - activities = { - r.activity_name: r.activity_value for r in scraper_data.activities - } + skills = {r.skill_name: r.skill_value for r in d.skills} + activities = {r.activity_name: r.activity_value for r in d.activities} hiscores.append( HighscoreData( **skills, **activities, - Player_id=scraper_data.player_id, - name=scraper_data.player_name, + Player_id=d.player_id, + name=d.player_name, ) ) return hiscores