From e9a254ad0a04d0c6f53139a495cbb25dda3d5fb7 Mon Sep 17 00:00:00 2001 From: DevilXD <4180725+DevilXD@users.noreply.github.com> Date: Sat, 14 Sep 2024 14:02:30 +0200 Subject: [PATCH] "Adding campaigns" phase now starts at 0 --- twitch.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/twitch.py b/twitch.py index 245dd4d..7557c34 100644 --- a/twitch.py +++ b/twitch.py @@ -1511,19 +1511,20 @@ class Twitch: self.inventory.append(campaign) # concurrently add the campaigns into the GUI # NOTE: this fetches pictures from the CDN, so might be slow without a cache + status_update( + _("gui", "status", "adding_campaigns").format(counter=f"(0/{len(campaigns)})") + ) for i, coro in enumerate( - asyncio.as_completed( - [ - asyncio.create_task(self.gui.inv.add_campaign(campaign)) - for campaign in campaigns - ] - ), + asyncio.as_completed([ + asyncio.create_task(self.gui.inv.add_campaign(campaign)) + for campaign in campaigns + ]), start=1, ): + await coro status_update( _("gui", "status", "adding_campaigns").format(counter=f"({i}/{len(campaigns)})") ) - await coro # this is needed here explicitly, because cache reads from disk don't raise this if self.gui.close_requested: raise ExitRequest()