Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto main
  • Loading branch information
codeconscious committed May 9, 2024
2 parents 59058b5 + 48ad770 commit 7f1367f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AudioTagger.Console/TagDuplicateFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public void Start(
return;
}

printer.Print($"Found {groupCount} duplicate group{(groupCount == 1 ? string.Empty : "s")} in {watch.ElapsedFriendly}.");
string groupLabel = Utilities.Pluralize(groupCount, "group", "groups");
printer.Print($"Found {groupCount} duplicate {groupLabel} in {watch.ElapsedFriendly}.");
PrintResults(duplicateGroups, printer);

string? searchFor = settings?.Duplicates?.PathSearchFor?.TextOrNull();
Expand Down
6 changes: 6 additions & 0 deletions AudioTagger.Library/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ public static string ConvertToSpectreColor(ConsoleColor color)
_ => "white"
};
}

public static string Pluralize(int count, string whenOne, string whenZeroOrMultiple) =>
count switch {
1 => whenOne,
_ => whenZeroOrMultiple
};
}

0 comments on commit 7f1367f

Please sign in to comment.