mirror: stop per-file lines resetting the progress gauge to 0%

parse_rclone_stats still accepted rclone's `Transferring:` entries
(`*  a.bin: 25% / 60 MiB, 0 B/s, -`) because they contain " / " and "%".
rclone writes them right after the byte-weighted line on every tick, and
since the last per-file entry is glued to the *next* tick's byte line,
the parsed order per second is: good byte line -> per-file 0% -> (one
second later) glued byte line. The gauge therefore displayed 0% almost
continuously and only ever looked right at the end.

Require a real stats body to start with the transferred byte amount.
Per-file lines now only feed the "current file" display (they already
did, as a fallback) and can no longer touch pct/done/total.

Verified with the real engine + rclone (bwlimit): mirror state now goes
0 -> 25 -> 50 -> 75 -> 100 with proper byte counts. The replay test now
asserts the exact parse sequence [10%, 40%] so a regression fails when a
per-file or file-count line sneaks in as 0%.

Bump to 0.3.1.
This commit is contained in:
Sebastian
2026-09-10 20:03:34 +02:00
parent 42a3f0c35a
commit 0ffe32ae08
4 changed files with 33 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "dap-tui"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
description = "Device sync for portable players — TUI edition (ratatui)"
license = "MIT"