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/") {
|
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||||
file.Link = file.Link[0:39]
|
file.Link = file.Link[0:39]
|
||||||
}
|
}
|
||||||
if err := file.State.Event(context.Background(), "repair_file"); err != nil {
|
file.State.Event(context.Background(), "repair_file")
|
||||||
t.log.Errorf("Cannot repair file %s: %v", file.Path, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
torrent.UnassignedLinks = mapset.NewSet[string]()
|
torrent.UnassignedLinks = mapset.NewSet[string]()
|
||||||
torrent.State.Event(context.Background(), "mark_as_repaired")
|
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/") {
|
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||||
file.Link = file.Link[0:39]
|
file.Link = file.Link[0:39]
|
||||||
}
|
}
|
||||||
if err := file.State.Event(context.Background(), "repair_file"); err != nil {
|
file.State.Event(context.Background(), "repair_file")
|
||||||
t.log.Errorf("Failed to mark file %s as repaired: %v", file.Path, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
assigned = true
|
assigned = true
|
||||||
assignedCount++
|
assignedCount++
|
||||||
}
|
}
|
||||||
@@ -552,10 +549,7 @@ func (t *TorrentManager) isStillBroken(info *realdebrid.TorrentInfo, brokenFiles
|
|||||||
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
if strings.HasPrefix(file.Link, "https://real-debrid.com/d/") {
|
||||||
file.Link = file.Link[0:39]
|
file.Link = file.Link[0:39]
|
||||||
}
|
}
|
||||||
if err := file.State.Event(context.Background(), "repair_file"); err != nil {
|
file.State.Event(context.Background(), "repair_file")
|
||||||
t.log.Errorf("Failed to mark file %s as repaired: %v", file.Path, err)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(brokenFiles) == 0 {
|
if len(brokenFiles) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user