diff --git a/src/Markdowser/Processing/Processors/HtmlProcessor.cs b/src/Markdowser/Processing/Processors/HtmlProcessor.cs index 42b9597..a74b830 100644 --- a/src/Markdowser/Processing/Processors/HtmlProcessor.cs +++ b/src/Markdowser/Processing/Processors/HtmlProcessor.cs @@ -49,7 +49,7 @@ internal partial class HtmlProcessor : IContentProcessor { _ = html.AppendLine(await streamReader.ReadLineAsync()); - progress.Report(new ProcessingProgress(contentStream.Position, length)); + progress.Report(new ProcessingProgress(Encoding.Default.GetByteCount(html.ToString()), length, "Downloading HTML...", true)); } HtmlDocument htmlDoc = new HtmlDocument(); @@ -68,7 +68,7 @@ internal partial class HtmlProcessor : IContentProcessor foreach (string line in lines) { - progress.Report(new ProcessingProgress(lines.Length, currentLine)); + progress.Report(new ProcessingProgress(currentLine, lines.Length, "Processing markdown...")); currentLine++; string trimmedLine = line.Trim(); diff --git a/src/Markdowser/ViewModels/MainWindowViewModel.cs b/src/Markdowser/ViewModels/MainWindowViewModel.cs index 6652486..bce5fe2 100644 --- a/src/Markdowser/ViewModels/MainWindowViewModel.cs +++ b/src/Markdowser/ViewModels/MainWindowViewModel.cs @@ -381,9 +381,6 @@ public partial class MainWindowViewModel : ViewModelBase private void UpdateProgress(ProcessingProgress progress) { - Progress = progress.Current; - ProgressMax = progress.Total; - if (progress.IsBytes) { ProgressText = $"{progress.Message} ({{1:0}}%) {BytesToString.Convert((long)Progress)}/{BytesToString.Convert((long)ProgressMax)}"; @@ -392,6 +389,9 @@ public partial class MainWindowViewModel : ViewModelBase { ProgressText = $"{progress.Message} ({{1:0}}%) {{0}}/{{3}}"; } + + ProgressMax = progress.Total; + Progress = progress.Current; } private void UrlChanged(object? sender, EventArgs e)