diff --git a/profiles/management/commands/recalculate.py b/profiles/management/commands/recalculate.py index 7f98769..18b8312 100644 --- a/profiles/management/commands/recalculate.py +++ b/profiles/management/commands/recalculate.py @@ -266,6 +266,7 @@ def recalculate_beatmaps_v2( while len(page := beatmaps_to_recalculate[:2000]) > 0: try: update_difficulty_calculations(page, difficulty_calculator) + pbar.update(len(page)) except CalculationException as e: ErrorReporter().report_error(e) pbar.write( @@ -273,7 +274,6 @@ def recalculate_beatmaps_v2( f"Error calculating difficulty values for beatmaps: {e}" ) ) - pbar.update(len(page)) self.stdout.write( self.style.SUCCESS( @@ -357,6 +357,7 @@ def recalculate_scores_v2( unique_beatmap_scores, difficulty_calculator, ) + pbar.update(unique_beatmap_scores.count()) except CalculationException as e: ErrorReporter().report_error(e) pbar.write( @@ -364,7 +365,6 @@ def recalculate_scores_v2( f"Error calculating performance values for beatmap {unique_beatmap['beatmap_id']} with mods {unique_beatmap['mods']}: {e}" ) ) - pbar.update(unique_beatmap_scores.count()) self.stdout.write( self.style.SUCCESS( diff --git a/profiles/services.py b/profiles/services.py index dbfedf1..69fd836 100644 --- a/profiles/services.py +++ b/profiles/services.py @@ -649,9 +649,9 @@ def calculate_difficulty_values( name=name, value=value, ) + for name, value in result.difficulty_values.items() ] for difficulty_calculation, result in zip(difficulty_calculations, results) - for name, value in result.difficulty_values.items() ] return values