From 38d59cb01d83e24f7fadc019dc736ffb63a8646a Mon Sep 17 00:00:00 2001 From: susan Date: Sat, 31 Jan 2026 11:27:05 -0800 Subject: [PATCH] fix: treat TorBox cached/completed status as downloaded For instant/cached TorBox downloads, the API returns DownloadFinished=false (no download happened - content was already cached) with DownloadState="cached" or "completed". These should be treated as "downloaded" since content is immediately available. Co-Authored-By: Claude Opus 4.5 --- pkg/debrid/providers/torbox/torbox.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/debrid/providers/torbox/torbox.go b/pkg/debrid/providers/torbox/torbox.go index 82c1054..b246371 100644 --- a/pkg/debrid/providers/torbox/torbox.go +++ b/pkg/debrid/providers/torbox/torbox.go @@ -171,10 +171,12 @@ func (tb *Torbox) SubmitMagnet(torrent *types.Torrent) (*types.Torrent, error) { } func (tb *Torbox) getTorboxStatus(status string, finished bool) string { - if finished { + // For cached/completed torrents, content is immediately available even if + // DownloadFinished=false (no download actually happened - it was already cached) + if finished || status == "cached" || status == "completed" { return "downloaded" } - downloading := []string{"completed", "cached", "paused", "downloading", "uploading", + downloading := []string{"paused", "downloading", "uploading", "checkingResumeData", "metaDL", "pausedUP", "queuedUP", "checkingUP", "forcedUP", "allocating", "downloading", "metaDL", "pausedDL", "queuedDL", "checkingDL", "forcedDL", "checkingResumeData", "moving"}