Skip to content

Commit

Permalink
Merge pull request rdavydov#378 from LeftMonster/master
Browse files Browse the repository at this point in the history
event-minute-watched update
  • Loading branch information
rdavydov committed Oct 15, 2023
2 parents a895889 + 13817a2 commit 19b2fde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TwitchChannelPointsMiner/classes/Twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,17 @@ def update_stream(self, streamer):
"broadcast_id": streamer.stream.broadcast_id,
"player": "site",
"user_id": self.twitch_login.get_user_id(),
"live": True,
"channel": streamer.username
}

if (
streamer.stream.game_name() is not None
and streamer.stream.game_id() is not None
and streamer.settings.claim_drops is True
):
event_properties["game"] = streamer.stream.game_name()
event_properties["game_id"] = streamer.stream.game_id()
# Update also the campaigns_ids so we are sure to tracking the correct campaign
streamer.stream.campaigns_ids = (
self.__get_campaign_ids_from_streamer(streamer)
Expand Down
3 changes: 3 additions & 0 deletions TwitchChannelPointsMiner/classes/entities/Stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def __str_game(self):

def game_name(self):
return None if self.game in [{}, None] else self.game["name"]

def game_id(self):
return None if self.game in [{}, None] else self.game["id"]

def update_required(self):
return self.__last_update == 0 or self.update_elapsed() >= 120
Expand Down

0 comments on commit 19b2fde

Please sign in to comment.