forked from Dniel97/artemis
fix the logic
This commit is contained in:
parent
9605c13e8e
commit
25ab37561d
@ -2388,16 +2388,18 @@ class IDACSeason2(IDACBase):
|
||||
vs_info["lose_now"] += 1 if data.get("win_flg") == 0 else 0
|
||||
vs_info["break_count"] += data.get("break_count")
|
||||
vs_info["break_penalty_flag"] = data.get("break_penalty_flag")
|
||||
course_exists = 0
|
||||
for course in vs_info["vsinfo_course_data"]:
|
||||
if course["course_id"] == data.get("course_id"):
|
||||
course["vs_cnt"] += 1
|
||||
course["vs_win"] += data.get("win_flg")
|
||||
else:
|
||||
course = {}
|
||||
course["course_id"] = data.get("course_id")
|
||||
course["vs_cnt"] = 1
|
||||
course["vs_win"] = data.get("win_flg")
|
||||
vs_info["vsinfo_course_data"].append(course)
|
||||
course_exists = 1
|
||||
if course_exists == 0:
|
||||
course = {}
|
||||
course["course_id"] = data.get("course_id")
|
||||
course["vs_cnt"] = 1
|
||||
course["vs_win"] = data.get("win_flg")
|
||||
vs_info["vsinfo_course_data"].append(course)
|
||||
self.data.item.put_vs_info(user_id, 0, vs_info)
|
||||
else:
|
||||
vs_info = {
|
||||
@ -2509,16 +2511,18 @@ class IDACSeason2(IDACBase):
|
||||
vs_info["lose_now"] += 1 if data.get("win_flg") == 0 else 0
|
||||
vs_info["break_count"] += data.get("break_count")
|
||||
vs_info["break_penalty_flag"] = data.get("break_penalty_flag")
|
||||
course_exists = 0
|
||||
for course in vs_info["vsinfo_course_data"]:
|
||||
if course["course_id"] == data.get("course_id"):
|
||||
course["vs_cnt"] += 1
|
||||
course["vs_win"] += data.get("win_flg")
|
||||
else:
|
||||
course = {}
|
||||
course["course_id"] = data.get("course_id")
|
||||
course["vs_cnt"] = 1
|
||||
course["vs_win"] = data.get("win_flg")
|
||||
vs_info["vsinfo_course_data"].append(course)
|
||||
course_exists = 1
|
||||
if course_exists == 0:
|
||||
course = {}
|
||||
course["course_id"] = data.get("course_id")
|
||||
course["vs_cnt"] = 1
|
||||
course["vs_win"] = data.get("win_flg")
|
||||
vs_info["vsinfo_course_data"].append(course)
|
||||
self.data.item.put_vs_info(user_id, 1, vs_info)
|
||||
else:
|
||||
vs_info = {
|
||||
|
Loading…
Reference in New Issue
Block a user