Check for other broken files when repairing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user