fix: directly set pausedUP state when debrid reports downloaded
All checks were successful
CI/CD / Build & Push Docker Image (push) Successful in 1m27s

Previous fix relied on IsReady() calculation which might still fail
due to edge cases with progress/AmountLeft values. This fix directly
sets state to pausedUP when debridTorrent.Status == "downloaded" and
TorrentPath is set, bypassing the IsReady() check entirely.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 11:16:41 -08:00
committed by John Ogle
parent 3a5289cb1d
commit b306248db6

View File

@@ -328,6 +328,17 @@ func (s *Store) updateTorrent(t *Torrent, debridTorrent *types.Torrent) *Torrent
t = s.partialTorrentUpdate(t, debridTorrent) t = s.partialTorrentUpdate(t, debridTorrent)
t.ContentPath = t.TorrentPath t.ContentPath = t.TorrentPath
// When debrid reports download complete and we have a path, mark as ready.
// This is a direct fix for TorBox where IsReady() might fail due to
// progress/AmountLeft calculation issues.
if debridTorrent.Status == "downloaded" && t.TorrentPath != "" {
t.State = "pausedUP"
t.Progress = 1.0
t.AmountLeft = 0
s.torrents.Update(t)
return t
}
if t.IsReady() { if t.IsReady() {
t.State = "pausedUP" t.State = "pausedUP"
s.torrents.Update(t) s.torrents.Update(t)