fix: TorBox downloads stuck in 'downloading' state
All checks were successful
CI/CD / Build & Push Docker Image (push) Successful in 1m17s
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user