Fix verify download link logic, remove the setting

This commit is contained in:
Ben Sarmiento
2024-02-17 15:01:46 +01:00
parent b2067dfb81
commit b4b4ebbc49
5 changed files with 7 additions and 28 deletions

View File

@@ -80,13 +80,6 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
}
}
if cfg.ShouldServeFromRclone() {
if cfg.ShouldVerifyDownloadLink() {
if !dl.client.CanFetchFirstByte(unrestrict.Download) {
log.Warnf("File %s is not available", fileName)
http.Error(resp, "File is not available", http.StatusInternalServerError)
return
}
}
redirect(resp, req, unrestrict.Download, cfg)
} else {
dl.streamFileToResponse(torrent, file, unrestrict, resp, req, torMgr, cfg, log)
@@ -105,13 +98,6 @@ func (dl *Downloader) DownloadLink(fileName, link string, resp http.ResponseWrit
return
} else {
if cfg.ShouldServeFromRclone() {
if cfg.ShouldVerifyDownloadLink() {
if !dl.client.CanFetchFirstByte(unrestrict.Download) {
log.Warnf("File %s is not available", fileName)
http.Error(resp, "File is not available", http.StatusInternalServerError)
return
}
}
redirect(resp, req, unrestrict.Download, cfg)
} else {
dl.streamFileToResponse(nil, nil, unrestrict, resp, req, torMgr, cfg, log)