Do not unrestrict files that are marked as broken until it is fixed
This commit is contained in:
@@ -56,7 +56,7 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
|
||||
return
|
||||
}
|
||||
|
||||
unrestrict := torMgr.UnrestrictUntilOk(file.Link)
|
||||
unrestrict := torMgr.UnrestrictFileUntilOk(file)
|
||||
if unrestrict == nil {
|
||||
file.IsBroken = true
|
||||
if cfg.EnableRepair() {
|
||||
@@ -91,7 +91,7 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
|
||||
// DownloadLink handles a GET request for downloads
|
||||
func (dl *Downloader) DownloadLink(fileName, link string, resp http.ResponseWriter, req *http.Request, torMgr *intTor.TorrentManager, cfg config.ConfigInterface, log *logutil.Logger) {
|
||||
// log.Debugf("Opening file %s (%s)", fileName, link)
|
||||
unrestrict := torMgr.UnrestrictUntilOk(link)
|
||||
unrestrict := torMgr.UnrestrictLinkUntilOk(link)
|
||||
if unrestrict == nil {
|
||||
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, link)
|
||||
http.Error(resp, "File is not available", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user