diff --git a/inventory.py b/inventory.py index f718a35..92d6bf4 100644 --- a/inventory.py +++ b/inventory.py @@ -49,6 +49,7 @@ class BaseDrop: self._preconditions # preconditions are met and self.campaign.active # campaign is active and not self.is_claimed # drop isn't already claimed + and self.starts_at <= datetime.utcnow() < self.ends_at # it's within the timeframe ) @property diff --git a/twitch.py b/twitch.py index 1b401c7..df1bef8 100644 --- a/twitch.py +++ b/twitch.py @@ -300,7 +300,7 @@ class Twitch: if drop is None: use_active = True logger.error(f"Missing drop: {drop_id}") - elif not drop.campaign.active: + elif not drop.can_earn: use_active = True else: drop.update_minutes(drop_data["currentMinutesWatched"]) @@ -421,7 +421,7 @@ class Twitch: # we aren't actually waiting for a progress update right now, so we can just # ignore the event this time return - elif drop is not None and drop.campaign.active: + elif drop is not None and drop.can_earn: drop.update_minutes(message["data"]["current_progress_min"]) drop.display() # Let the watch loop know we've handled it here