Fix possible issues

This commit is contained in:
Ben Sarmiento
2024-01-31 18:08:48 +01:00
parent 7794e641ab
commit 4c9b54c01c
6 changed files with 52 additions and 60 deletions

View File

@@ -48,7 +48,11 @@ func (dl *Downloader) DownloadFile(directory, torrentName, fileName string, resp
// log.Debugf("Opening file %s from torrent %s (%s)", fileName, torMgr.GetKey(torrent), file.Link)
if file.IsBroken {
http.Error(resp, "File is not available", http.StatusInternalServerError)
if cfg.EnableRepair() {
http.Error(resp, "File is temporarily unavailable", http.StatusInternalServerError)
} else {
http.Error(resp, "File is not available", http.StatusNotFound)
}
return
}