Skip to content

Commit

Permalink
fixed OnDownloadProgressChanged of sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Sep 19, 2024
1 parent 71bef71 commit 4fa8348
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Samples/Downloader.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@ private static void OnChunkDownloadProgressChanged(object sender, DownloadProgre

private static void OnDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
ConsoleProgress.Tick((int)(e.ProgressPercentage * 100));
var isPaused = false;
if (sender is DownloadService ds)
{
var title = e.UpdateTitleInfo(ds.IsPaused);
ConsoleProgress.Message = title;
isPaused = ds.IsPaused;
}
var title = e.UpdateTitleInfo(isPaused);
ConsoleProgress.Tick((int)(e.ProgressPercentage * 100), title);
}
}

0 comments on commit 4fa8348

Please sign in to comment.