Check for other broken files when repairing

This commit is contained in:
Ben Sarmiento
2024-05-25 01:51:00 +02:00
parent 0a086d7a14
commit abb80b4257
3 changed files with 12 additions and 4 deletions

View File

@@ -173,6 +173,16 @@ func (t *TorrentManager) repair(torrent *Torrent) {
return
}
// check for other broken files
torrent.SelectedFiles.IterCb(func(_ string, file *File) {
if !file.State.Is("ok_file") {
return
}
if t.UnrestrictFileUntilOk(file) == nil {
file.State.Event(context.Background(), "break_file")
}
})
brokenFiles, allBroken := getBrokenFiles(torrent)
// first step: redownload the whole torrent