fix: progress always at 0% and context cancelled before sendDocument
All checks were successful
CI / build (push) Successful in 50s

- Fix progress template: remove spurious stderr: prefix and switch to
  _percent_str/_speed_str/_eta_str keys (progress.percent outputs NA
  for HLS streams with unknown total size)
- Update progress regex to match new template format:
  DLPROG| 45.2%|   1.05MiB/s|00:45
- Fix context cancellation bug: clearActiveJob was cancelling dlCtx
  before handleDownloadCompletion could send the document
- Update progress test cases to match new template output format
This commit is contained in:
2026-06-25 23:49:27 +03:30
parent 37e7f918d0
commit 7c02cd3d89
4 changed files with 22 additions and 8 deletions

View File

@@ -285,7 +285,7 @@ func (c *Client) StartDownload(job *domain.DownloadJob, downloadDir string) (<-c
// Progress reporting using progress-template for machine-readable output
args = append(args, "--newline")
args = append(args, "--progress-template", "stderr:DLPROG|%(progress.percent)s|%(progress.speed)s|%(progress.eta)s")
args = append(args, "--progress-template", "DLPROG|%(progress._percent_str)s|%(progress._speed_str)s|%(progress._eta_str)s")
// Language selection if specified
if job.Language != "" {