"Adding campaigns" phase now starts at 0
This commit is contained in:
1 parent
a30e8d3ce4
commit
e9a254ad0a
1 file changed
+8
-7
@@ -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()
|
||||||
|
|||||||
Reference in new issue
Block a user