fix: directly set pausedUP state when debrid reports downloaded
All checks were successful
CI/CD / Build & Push Docker Image (push) Successful in 1m27s
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:
@@ -328,6 +328,17 @@ func (s *Store) updateTorrent(t *Torrent, debridTorrent *types.Torrent) *Torrent
|
||||
t = s.partialTorrentUpdate(t, debridTorrent)
|
||||
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() {
|
||||
t.State = "pausedUP"
|
||||
s.torrents.Update(t)
|
||||
|
||||
Reference in New Issue
Block a user