Fixers and repairs
This commit is contained in:
@@ -104,11 +104,11 @@ func (t *TorrentManager) Repair(torrent *Torrent) {
|
||||
t.log.Warnf("Torrent %s is unfixable, skipping repair", t.GetKey(torrent))
|
||||
return
|
||||
}
|
||||
if t.Repairs.Contains(t.GetKey(torrent)) {
|
||||
if t.repairs.Contains(t.GetKey(torrent)) {
|
||||
t.log.Warnf("Torrent %s is already being repaired, skipping repair", t.GetKey(torrent))
|
||||
return
|
||||
}
|
||||
t.Repairs.Add(t.GetKey(torrent))
|
||||
t.repairs.Add(t.GetKey(torrent))
|
||||
// save the broken files to the file cache
|
||||
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
||||
torrent.DownloadedIDs.Each(func(id string) bool {
|
||||
@@ -126,7 +126,7 @@ func (t *TorrentManager) Repair(torrent *Torrent) {
|
||||
})
|
||||
_ = t.workerPool.Submit(func() {
|
||||
t.repair(torrent)
|
||||
t.Repairs.Remove(t.GetKey(torrent))
|
||||
t.repairs.Remove(t.GetKey(torrent))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ func (t *TorrentManager) redownloadTorrent(torrent *Torrent, brokenFiles string)
|
||||
t.Api.DeleteTorrent(id)
|
||||
}
|
||||
} else {
|
||||
t.onlyForRepair.Set(newTorrentID, torrent)
|
||||
t.fixers.Set(newTorrentID, torrent)
|
||||
}
|
||||
return info, nil
|
||||
}
|
||||
@@ -330,7 +330,7 @@ func (t *TorrentManager) redownloadTorrent(torrent *Torrent, brokenFiles string)
|
||||
t.Api.DeleteTorrent(id)
|
||||
}
|
||||
} else {
|
||||
t.onlyForRepair.Set(newTorrentID, torrent)
|
||||
t.fixers.Set(newTorrentID, torrent)
|
||||
}
|
||||
return info, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user