Skip to content

Commit

Permalink
Handle people using my API
Browse files Browse the repository at this point in the history
  • Loading branch information
Chats committed May 23, 2024
1 parent ce0cf48 commit 36dbbd2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/data/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,16 @@ async def update_all(self):
self.raw_data[key]["data"] = responses[i]
self.raw_data[key]["update_time"] = int(time())
if key == "updates":
self.raw_data[key]["data"] = await self.format_steam_news(
self.raw_data[key]["data"]["appnews"]["newsitems"]
)
if (
self.raw_data[key]["data"]
.get("appnews", {})
.get("newsitems", {})
):
# If pulling from steam, we gotta format, otherwise you're probably using my shit, so it's already formatted
# and we just leave it alone
self.raw_data[key]["data"] = await self.format_steam_news(
self.raw_data[key]["data"]["appnews"]["newsitems"]
)
self.update_time = int(time())

async def fetch_all(self):
Expand Down

0 comments on commit 36dbbd2

Please sign in to comment.