Skip to content

Commit b46b77d

Browse files
committed
Fix inventory view display issues with campaigns having both timed and sub-based drops
1 parent 6d80397 commit b46b77d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gui.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1503,9 +1503,13 @@ def update_progress(self, drop: TimedDrop, label: ttk.Label) -> None:
15031503
time=drop.ends_at.astimezone().replace(microsecond=0, tzinfo=None)
15041504
)
15051505
else:
1506-
progress_text = _("gui", "inventory", "minutes_progress").format(
1507-
minutes=drop.required_minutes
1508-
)
1506+
if drop.required_minutes > 0:
1507+
progress_text = _("gui", "inventory", "minutes_progress").format(
1508+
minutes=drop.required_minutes
1509+
)
1510+
else:
1511+
# required_minutes is zero for subscription-based drops
1512+
progress_text = ''
15091513
if datetime.now(timezone.utc) < drop.starts_at > drop.campaign.starts_at:
15101514
# this drop can only be earned later than the campaign start
15111515
progress_text += '\n' + _("gui", "inventory", "starts").format(

inventory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def has_badge_or_emote(self) -> bool:
370370

371371
@cached_property
372372
def finished(self) -> bool:
373-
return all(d.is_claimed for d in self.drops)
373+
return all(d.is_claimed or d.required_minutes <= 0 for d in self.drops)
374374

375375
@cached_property
376376
def claimed_drops(self) -> int:

0 commit comments

Comments
 (0)