Readd campaign's get_drop
This commit is contained in:
1 parent
d90d20a42c
commit
3ccbd4c3db
2 files changed
+5
-4
No files matched your search
@@ -251,3 +251,6 @@ class DropsCampaign:
|
|||||||
|
|
||||||
def _on_minutes_changed(self) -> None:
|
def _on_minutes_changed(self) -> None:
|
||||||
invalidate_cache(self, "progress", "remaining_minutes")
|
invalidate_cache(self, "progress", "remaining_minutes")
|
||||||
|
|
||||||
|
def get_drop(self, drop_id: str) -> Optional[TimedDrop]:
|
||||||
|
return self.timed_drops.get(drop_id)
|
||||||
@@ -828,13 +828,11 @@ class Twitch:
|
|||||||
# try it with the currently selected game first
|
# try it with the currently selected game first
|
||||||
if self.game is not None:
|
if self.game is not None:
|
||||||
for campaign in self.inventory[self.game]:
|
for campaign in self.inventory[self.game]:
|
||||||
drop = campaign.timed_drops.get(drop_id)
|
if (drop := campaign.get_drop(drop_id)) is not None:
|
||||||
if drop is not None:
|
|
||||||
return drop
|
return drop
|
||||||
# fallback to checking all campaigns
|
# fallback to checking all campaigns
|
||||||
for campaign in chain(*self.inventory.values()):
|
for campaign in chain(*self.inventory.values()):
|
||||||
drop = campaign.timed_drops.get(drop_id)
|
if (drop := campaign.get_drop(drop_id)) is not None:
|
||||||
if drop is not None:
|
|
||||||
return drop
|
return drop
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user