Skip to content

Commit

Permalink
Add 'Number of unique files played' statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
kangalio committed Nov 12, 2019
1 parent e08cf17 commit bd3dc69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ def gen_text_general_info(xml, r):
long_mcombo_str = "[please load replay data]"

scores = list(iter_scores(xml))
num_charts = len(list(xml.iter("Chart")))
hours = sum(float(s.findtext("SurviveSeconds")) / 3600 for s in scores)
first_play_date = min([parsedate(s.findtext("DateTime")) for s in scores])
duration = relativedelta(datetime.now(), first_play_date)
Expand All @@ -452,6 +453,7 @@ def gen_text_general_info(xml, r):
f"You started playing {duration.years} years {duration.months} months ago",
f"Total hours spent playing: {round(hours)} hours",
f"Number of scores: {len(scores)}",
f"Number of unique files played: {num_charts}",
f"Total arrows hit: {total_notes_string}",
f"Longest combo: {long_combo_str}",
f"Longest marvelous combo: {long_mcombo_str}",
Expand Down

0 comments on commit bd3dc69

Please sign in to comment.