Reinsert the broken files

This commit is contained in:
Ben Sarmiento
2024-01-14 21:31:09 +01:00
parent d76a99adbf
commit 5b8ea46fa4

View File

@@ -134,22 +134,6 @@ func (t *TorrentManager) repair(torrent *Torrent) {
return
}
if torrent.OlderThanDuration(EXPIRED_LINK_TOLERANCE_HOURS * time.Hour) {
// first solution: reinsert with same selection
t.log.Infof("Torrent %s is older than %d hours, reinserting it", t.GetKey(torrent), EXPIRED_LINK_TOLERANCE_HOURS)
if t.reinsertTorrent(torrent, "") {
t.log.Infof("Successfully downloaded torrent %s to repair it", t.GetKey(torrent))
return
} else if torrent.Unfixable {
t.log.Warnf("Cannot repair torrent %s", t.GetKey(torrent))
return
} else {
t.log.Warnf("Failed to repair by reinserting torrent %s, will only redownload broken files...", t.GetKey(torrent))
}
} else {
t.log.Warnf("Torrent %s is not older than %d hours to be repaired by reinsertion, will only redownload broken files...", t.GetKey(torrent), EXPIRED_LINK_TOLERANCE_HOURS)
}
// handle torrents with incomplete links for selected files
assignedCount := 0
rarCount := 0