Get more info first before reading progress status and links
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user