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
|
idx := i
|
||||||
t.workerPool.Submit(func() {
|
t.workerPool.Submit(func() {
|
||||||
defer wg.Done()
|
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])
|
tInfo := t.getMoreInfo(instances[idx])
|
||||||
if tInfo == nil {
|
if tInfo == nil {
|
||||||
// just in case!
|
// just in case!
|
||||||
mergeChan <- nil
|
mergeChan <- nil
|
||||||
return
|
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)
|
torrent := t.convertToTorrent(tInfo)
|
||||||
accessKey := t.GetKey(torrent)
|
accessKey := t.GetKey(torrent)
|
||||||
freshAccessKeys.Add(accessKey)
|
freshAccessKeys.Add(accessKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user