diff --git a/internal/engine/watch_reporter.go b/internal/engine/watch_reporter.go index e7fa4da..9e6c185 100644 --- a/internal/engine/watch_reporter.go +++ b/internal/engine/watch_reporter.go @@ -47,7 +47,7 @@ func (wr *WatchReporter) Run(ctx context.Context) { } func (wr *WatchReporter) sendReport(ctx context.Context) { - pct, _ := wr.server.EstimatedProgress() + pct, durSec := wr.server.EstimatedProgress() if pct == 0 || pct == wr.lastSentPct { return } @@ -58,6 +58,11 @@ func (wr *WatchReporter) sendReport(ctx context.Context) { Source: "range", Progress: &pct, } + if durSec > 0 { + update.Duration = &durSec + pos := int(float64(pct) / 100 * float64(durSec)) + update.Position = &pos + } reportCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel()