Allow repairing file from ok state
This commit is contained in:
@@ -257,9 +257,7 @@ func (t *TorrentManager) convertToTorrent(info *realdebrid.TorrentInfo) *Torrent
|
||||
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||
file.Link = file.Link[0:39]
|
||||
}
|
||||
if err := file.State.Event(context.Background(), "repair_file"); err != nil {
|
||||
t.log.Errorf("Cannot repair file %s: %v", file.Path, err)
|
||||
}
|
||||
file.State.Event(context.Background(), "repair_file")
|
||||
}
|
||||
torrent.UnassignedLinks = mapset.NewSet[string]()
|
||||
torrent.State.Event(context.Background(), "mark_as_repaired")
|
||||
|
||||
@@ -289,10 +289,7 @@ func (t *TorrentManager) assignLinks(torrent *Torrent) bool {
|
||||
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||
file.Link = file.Link[0:39]
|
||||
}
|
||||
if err := file.State.Event(context.Background(), "repair_file"); err != nil {
|
||||
t.log.Errorf("Failed to mark file %s as repaired: %v", file.Path, err)
|
||||
return
|
||||
}
|
||||
file.State.Event(context.Background(), "repair_file")
|
||||
assigned = true
|
||||
assignedCount++
|
||||
}
|
||||
@@ -552,10 +549,7 @@ func (t *TorrentManager) isStillBroken(info *realdebrid.TorrentInfo, brokenFiles
|
||||
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||
file.Link = file.Link[0:39]
|
||||
}
|
||||
if err := file.State.Event(context.Background(), "repair_file"); err != nil {
|
||||
t.log.Errorf("Failed to mark file %s as repaired: %v", file.Path, err)
|
||||
return true
|
||||
}
|
||||
file.State.Event(context.Background(), "repair_file")
|
||||
}
|
||||
|
||||
if len(brokenFiles) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user