fix: TorBox downloads stuck in 'downloading' state
All checks were successful
CI/CD / Build & Push Docker Image (push) Successful in 1m17s

Fixed race condition where TorBox reports DownloadFinished=true but
Progress < 1.0, causing IsReady() to return false and state to stay
"downloading" instead of transitioning to "pausedUP".

Also added Gitea CI workflow to push images to internal registry.

Fixes: dcy-355

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-28 22:57:36 -08:00
committed by John Ogle
parent 207d43b13f
commit 3a5289cb1d
3 changed files with 69 additions and 1 deletions

View File

@@ -270,6 +270,12 @@ func (s *Store) partialTorrentUpdate(t *Torrent, debridTorrent *types.Torrent) *
if math.IsNaN(progress) || math.IsInf(progress, 0) {
progress = 0
}
// When debrid reports download complete, force progress to 100% to ensure
// IsReady() returns true. This fixes a race condition where TorBox can report
// DownloadFinished=true but Progress < 1.0, causing state to stay "downloading".
if debridTorrent.Status == "downloaded" {
progress = 1.0
}
sizeCompleted := int64(float64(totalSize) * progress)
var speed int64