From 43a94118f4c6f478eb3f4d775ea111c1d45ec0b9 Mon Sep 17 00:00:00 2001 From: susan Date: Sat, 31 Jan 2026 11:30:23 -0800 Subject: [PATCH] debug: add logging and case-insensitive check for TorBox status Added debug logging to see actual DownloadState values from TorBox API. Also made status comparison case-insensitive. Co-Authored-By: Claude Opus 4.5 --- pkg/debrid/providers/torbox/torbox.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/debrid/providers/torbox/torbox.go b/pkg/debrid/providers/torbox/torbox.go index b246371..64af4c5 100644 --- a/pkg/debrid/providers/torbox/torbox.go +++ b/pkg/debrid/providers/torbox/torbox.go @@ -171,9 +171,17 @@ func (tb *Torbox) SubmitMagnet(torrent *types.Torrent) (*types.Torrent, error) { } func (tb *Torbox) getTorboxStatus(status string, finished bool) string { + // Log raw values for debugging + tb.logger.Debug(). + Str("download_state", status). + Bool("download_finished", finished). + Msg("getTorboxStatus called") + // 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" { + // Use case-insensitive comparison for safety + statusLower := strings.ToLower(status) + if finished || statusLower == "cached" || statusLower == "completed" { return "downloaded" } downloading := []string{"paused", "downloading", "uploading",