Remove link on repair

This commit is contained in:
Ben Sarmiento
2024-01-26 12:59:00 +01:00
parent 4852b93c67
commit 58b0b8b917
2 changed files with 32 additions and 33 deletions

View File

@@ -55,7 +55,7 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
if unrestrict == nil {
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, link)
torrent.BrokenLinks.Add(file.Link)
file.Link = "repair"
// file.Link = "repair"
if cfg.EnableRepair() {
torMgr.SetNewLatestState(intTor.LibraryState{})
} else {
@@ -167,7 +167,7 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
log.Warnf("Cannot download file %s: %v", unrestrict.Download, err)
if file != nil && unrestrict.Streamable == 1 {
torrent.BrokenLinks.Add(file.Link)
file.Link = "repair"
// file.Link = "repair"
if cfg.EnableRepair() && torrent != nil {
torMgr.SetNewLatestState(intTor.LibraryState{})
} else {
@@ -184,7 +184,7 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
if file != nil && unrestrict.Streamable == 1 {
log.Warnf("Received a %s status code for file %s", download.Status, file.Path)
torrent.BrokenLinks.Add(file.Link)
file.Link = "repair"
// file.Link = "repair"
if cfg.EnableRepair() && torrent != nil {
torMgr.SetNewLatestState(intTor.LibraryState{})
} else {