Fix detection of whether or not a drop can be progressed
This commit is contained in:
1 parent
1af56199fc
commit
8d77a362b5
2 files changed
+3
-2
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user