Fix inventory view display issues with campaigns having both timed and sub-based drops
This commit is contained in:
1 parent
6d803978a3
commit
b46b77d20c
2 files changed
+5
-1
No files matched your search
@@ -1503,9 +1503,13 @@ class InventoryOverview:
|
|||||||
time=drop.ends_at.astimezone().replace(microsecond=0, tzinfo=None)
|
time=drop.ends_at.astimezone().replace(microsecond=0, tzinfo=None)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
if drop.required_minutes > 0:
|
||||||
progress_text = _("gui", "inventory", "minutes_progress").format(
|
progress_text = _("gui", "inventory", "minutes_progress").format(
|
||||||
minutes=drop.required_minutes
|
minutes=drop.required_minutes
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
# required_minutes is zero for subscription-based drops
|
||||||
|
progress_text = ''
|
||||||
if datetime.now(timezone.utc) < drop.starts_at > drop.campaign.starts_at:
|
if datetime.now(timezone.utc) < drop.starts_at > drop.campaign.starts_at:
|
||||||
# this drop can only be earned later than the campaign start
|
# this drop can only be earned later than the campaign start
|
||||||
progress_text += '\n' + _("gui", "inventory", "starts").format(
|
progress_text += '\n' + _("gui", "inventory", "starts").format(
|
||||||
|
|||||||
+1
-1
@@ -370,7 +370,7 @@ class DropsCampaign:
|
|||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def finished(self) -> bool:
|
def finished(self) -> bool:
|
||||||
return all(d.is_claimed for d in self.drops)
|
return all(d.is_claimed or d.required_minutes <= 0 for d in self.drops)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def claimed_drops(self) -> int:
|
def claimed_drops(self) -> int:
|
||||||
|
|||||||
Reference in new issue
Block a user