Documents/Pdf: fix progression

This commit is contained in:
2023-10-19 23:25:55 +02:00
parent a075189bdd
commit 841f8bfb84

View File

@ -47,7 +47,7 @@ namespace Elwig.Documents {
return Array.Empty<int>();
} else if (line.StartsWith("progress:")) {
var parts = line[9..].Trim().Split('/').Select(int.Parse).ToArray();
progress?.Report(parts[0] / (double)parts[1]);
progress?.Report(100.0 * parts[0] / parts[1]);
} else if (line.StartsWith("success:")) {
var m = Regex.Match(line, @"\(([0-9, ]+)\)");
return m.Groups[1].Value.Split(", ").Select(int.Parse);