Attempt to fix PREDICTION showing with count -1 in final report

This commit is contained in:
Thomas Couchoud
2021-02-03 18:35:09 +01:00
parent 91a7bda0da
commit 80f8ebd476
2 changed files with 2 additions and 6 deletions

View File

@@ -293,9 +293,8 @@ class WebSocketsPool:
"REFUND",
-points_placed,
counter=-1,
create_if_missing=False,
)
else:
elif result_type == "WIN":
logger.info(
"REMOVE PREDICTION FROM POINTS MSG"
) # TODO remove
@@ -303,7 +302,6 @@ class WebSocketsPool:
"PREDICTION",
-points_won,
counter=-1,
create_if_missing=False,
)
elif message.type == "prediction-made":
event_prediction.bet_confirmed = True

View File

@@ -91,10 +91,8 @@ class Streamer(object):
]
)
def update_history(self, reason_code, earned, counter=1, create_if_missing=True):
def update_history(self, reason_code, earned, counter=1):
if reason_code not in self.history:
if not create_if_missing:
return
self.history[reason_code] = {"counter": 0, "amount": 0}
self.history[reason_code]["counter"] += counter
self.history[reason_code]["amount"] += earned