Skip to content

Commit

Permalink
Don't show progress notifications when there are too few items to be …
Browse files Browse the repository at this point in the history
…worthwhile
  • Loading branch information
peppy committed Dec 18, 2023
1 parent 03ac2c3 commit 9aaaa12
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions osu.Game/BackgroundDataStoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private void processBeatmapSetsWithMissingMetrics()
Logger.Log($"Found {beatmapSetIds.Count} beatmap sets which require reprocessing.");

// Technically this is doing more than just star ratings, but easier for the end user to understand.
var notification = showProgressNotification("Reprocessing star rating for beatmaps", "beatmaps' star ratings have been updated");
var notification = showProgressNotification(beatmapSetIds.Count, "Reprocessing star rating for beatmaps", "beatmaps' star ratings have been updated");

int processedCount = 0;
int failedCount = 0;
Expand Down Expand Up @@ -205,7 +205,7 @@ private void processBeatmapsWithMissingObjectCounts()

Logger.Log($"Found {beatmapIds.Count} beatmaps which require statistics population.");

var notification = showProgressNotification("Populating missing statistics for beatmaps", "beatmaps have been populated with missing statistics");
var notification = showProgressNotification(beatmapIds.Count, "Populating missing statistics for beatmaps", "beatmaps have been populated with missing statistics");

int processedCount = 0;
int failedCount = 0;
Expand Down Expand Up @@ -266,7 +266,7 @@ private void processScoresWithMissingStatistics()

Logger.Log($"Found {scoreIds.Count} scores which require statistics population.");

var notification = showProgressNotification("Populating missing statistics for scores", "scores have been populated with missing statistics");
var notification = showProgressNotification(scoreIds.Count, "Populating missing statistics for scores", "scores have been populated with missing statistics");

int processedCount = 0;
int failedCount = 0;
Expand Down Expand Up @@ -325,7 +325,7 @@ private void convertLegacyTotalScoreToStandardised()
if (scoreIds.Count == 0)
return;

var notification = showProgressNotification("Upgrading scores to new scoring algorithm", "scores have been upgraded to the new scoring algorithm");
var notification = showProgressNotification(scoreIds.Count, "Upgrading scores to new scoring algorithm", "scores have been upgraded to the new scoring algorithm");

int processedCount = 0;
int failedCount = 0;
Expand Down Expand Up @@ -405,11 +405,14 @@ private void completeNotification(ProgressNotification? notification, int proces
}
}

private ProgressNotification? showProgressNotification(string running, string completed)
private ProgressNotification? showProgressNotification(int totalCount, string running, string completed)
{
if (notificationOverlay == null)
return null;

if (totalCount < 10)
return null;

ProgressNotification notification = new ProgressNotification
{
Text = running,
Expand Down

0 comments on commit 9aaaa12

Please sign in to comment.