"Adding campaigns" phase now starts at 0

This commit is contained in:
DevilXD committed 2024-09-14 14:02:30 +02:00
1 parent a30e8d3ce4
commit e9a254ad0a
1 file changed
+6 -5
+6 -5
View File
@@ -1511,19 +1511,20 @@ class Twitch:
self.inventory.append(campaign) self.inventory.append(campaign)
# concurrently add the campaigns into the GUI # concurrently add the campaigns into the GUI
# NOTE: this fetches pictures from the CDN, so might be slow without a cache # 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( for i, coro in enumerate(
asyncio.as_completed( asyncio.as_completed([
[
asyncio.create_task(self.gui.inv.add_campaign(campaign)) asyncio.create_task(self.gui.inv.add_campaign(campaign))
for campaign in campaigns for campaign in campaigns
] ]),
),
start=1, start=1,
): ):
await coro
status_update( status_update(
_("gui", "status", "adding_campaigns").format(counter=f"({i}/{len(campaigns)})") _("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 # this is needed here explicitly, because cache reads from disk don't raise this
if self.gui.close_requested: if self.gui.close_requested:
raise ExitRequest() raise ExitRequest()