diff --git a/internal/torrent/refresh.go b/internal/torrent/refresh.go index c6c2334..d51078d 100644 --- a/internal/torrent/refresh.go +++ b/internal/torrent/refresh.go @@ -38,21 +38,20 @@ func (t *TorrentManager) refreshTorrents(initialRun bool) { idx := i t.workerPool.Submit(func() { defer wg.Done() - status := instances[idx].Status - if status != "downloading" && status != "downloaded" && status != "uploading" && status != "queued" && status != "compressing" && status != "waiting_files_selection" { - t.deleteOnceDone(instances[idx].ID, true) - } - if instances[idx].Progress != 100 { - mergeChan <- nil - return - } - tInfo := t.getMoreInfo(instances[idx]) if tInfo == nil { // just in case! mergeChan <- nil return } + status := tInfo.Status + if status != "downloading" && status != "downloaded" && status != "uploading" && status != "queued" && status != "compressing" && status != "waiting_files_selection" { + t.deleteOnceDone(tInfo.ID, true) + } + if tInfo.Progress != 100 || len(tInfo.Links) == 0 { + mergeChan <- nil + return + } torrent := t.convertToTorrent(tInfo) accessKey := t.GetKey(torrent) freshAccessKeys.Add(accessKey)