Skip to content

Commit

Permalink
Fix issue with requesting pages which no longer exist
Browse files Browse the repository at this point in the history
  • Loading branch information
MyNameIsRomayne committed Aug 26, 2024
1 parent ca8ff5e commit 2e7ee2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion auction.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ def update(self, refresh_seconds = 600, do_printout=True):
# We now have at least something in auctiondata, including total pages and stuff
print("Updating auction pages. Please do not interrupt the program, retrieved data is only stored upon completion.")
pbar = progressbar.ProgressBar(maxval=self.total_pages).start()
for pageNum in range(start_page, self.total_pages):
# Done with a counter instead of a for-loop as total_pages may update.
# This thus prevents issues with trying to get pages beyond what currently exist, but used to
pageNum = start_page
while pageNum < self.total_pages:
pbar.update(pageNum + 1)
self.get_page(pageNum)
pageNum += 1
self.save_to_local()

def get_auctions_as_list(self) -> list[SkyblockAuctionData]:
Expand Down

0 comments on commit 2e7ee2c

Please sign in to comment.