Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions howlongtobeatpy/howlongtobeatpy/JSONResultParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ def parse_json_element(self, input_game_element):
current_entry.json_content = input_game_element
# Add a few times elements as help for the user
# Calculate only if value is not None
if "comp_main" in input_game_element:
if "comp_main" in input_game_element and input_game_element.get("comp_main") is not None:
current_entry.main_story = round(input_game_element.get("comp_main") / 3600, 2)
if "comp_plus" in input_game_element:
if "comp_plus" in input_game_element and input_game_element.get("comp_plus") is not None:
current_entry.main_extra = round(input_game_element.get("comp_plus") / 3600, 2)
if "comp_100" in input_game_element:
if "comp_100" in input_game_element and input_game_element.get("comp_100") is not None:
current_entry.completionist = round(input_game_element.get("comp_100") / 3600, 2)
if "comp_all" in input_game_element:
if "comp_all" in input_game_element and input_game_element.get("comp_all") is not None:
current_entry.all_styles = round(input_game_element.get("comp_all") / 3600, 2)
if "invested_co" in input_game_element:
if "invested_co" in input_game_element and input_game_element.get("invested_co") is not None:
current_entry.coop_time = round(input_game_element.get("invested_co") / 3600, 2)
if "invested_mp" in input_game_element:
if "invested_mp" in input_game_element and input_game_element.get("invested_mp") is not None:
current_entry.mp_time = round(input_game_element.get("invested_mp") / 3600, 2)
# Add complexity booleans
current_entry.complexity_lvl_combine = bool(input_game_element.get("comp_lvl_combine", 0))
Expand Down
Loading