Rigorous fix check
This commit is contained in:
@@ -31,7 +31,7 @@ func (t *TorrentManager) repairAll() {
|
||||
toRepair := mapset.NewSet[*Torrent]()
|
||||
|
||||
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
||||
if torrent.AnyInProgress() || torrent.UnrepairableReason != "" {
|
||||
if torrent.AnyInProgress() || torrent.AllInProgress() || torrent.UnrepairableReason != "" {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ func (t *TorrentManager) Repair(torrent *Torrent) {
|
||||
t.log.Warnf("Torrent %s is already being repaired, skipping repair", t.GetKey(torrent))
|
||||
return
|
||||
}
|
||||
if torrent.AnyInProgress() {
|
||||
if torrent.AnyInProgress() || torrent.AllInProgress() {
|
||||
t.log.Infof("Torrent %s is in progress, skipping repair until download is done", t.GetKey(torrent))
|
||||
return
|
||||
}
|
||||
@@ -344,9 +344,12 @@ func (t *TorrentManager) redownloadTorrent(torrent *Torrent, selection string) (
|
||||
|
||||
if len(oldTorrentIDs) > 0 {
|
||||
// replace the old torrent
|
||||
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
||||
for _, id := range oldTorrentIDs {
|
||||
torrent.DownloadedIDs.Remove(id)
|
||||
t.Api.DeleteTorrent(id)
|
||||
t.deleteOnceDone.Add(id)
|
||||
infoCache.Remove(id)
|
||||
}
|
||||
} else {
|
||||
// it's a fixer
|
||||
|
||||
Reference in New Issue
Block a user