fix: treat TorBox cached/completed status as downloaded
All checks were successful
CI/CD / Build & Push Docker Image (push) Successful in 1m11s
All checks were successful
CI/CD / Build & Push Docker Image (push) Successful in 1m11s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user