Trigger refresh library instead of repair

This commit is contained in:
Ben Sarmiento
2024-01-19 01:41:20 +01:00
parent bacee5178a
commit 2c43cf9b12

View File

@@ -58,7 +58,7 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
if cfg.EnableRepair() { if cfg.EnableRepair() {
torrent.BrokenLinks.Add(file.Link) torrent.BrokenLinks.Add(file.Link)
file.Link = "repair" file.Link = "repair"
torMgr.Repair(torrent) torMgr.SetNewLatestState(intTor.LibraryState{})
} else { } else {
log.Infof("Repair is disabled, skipping repair for unavailable file %s (link=%s)", fileName, link) log.Infof("Repair is disabled, skipping repair for unavailable file %s (link=%s)", fileName, link)
} }
@@ -162,7 +162,7 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
if cfg.EnableRepair() && torrent != nil { if cfg.EnableRepair() && torrent != nil {
torrent.BrokenLinks.Add(file.Link) torrent.BrokenLinks.Add(file.Link)
file.Link = "repair" file.Link = "repair"
torMgr.Repair(torrent) torMgr.SetNewLatestState(intTor.LibraryState{})
} else { } else {
log.Infof("Repair is disabled, skipping repair for unavailable file %s (link=%s)", file.Path, file.Link) log.Infof("Repair is disabled, skipping repair for unavailable file %s (link=%s)", file.Path, file.Link)
} }
@@ -178,7 +178,7 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
if cfg.EnableRepair() && torrent != nil { if cfg.EnableRepair() && torrent != nil {
torrent.BrokenLinks.Add(file.Link) torrent.BrokenLinks.Add(file.Link)
file.Link = "repair" file.Link = "repair"
torMgr.Repair(torrent) torMgr.SetNewLatestState(intTor.LibraryState{})
} else { } else {
log.Infof("Repair is disabled, skipping repair for unavailable file %s (link=%s)", file.Path, file.Link) log.Infof("Repair is disabled, skipping repair for unavailable file %s (link=%s)", file.Path, file.Link)
} }