Verify if downloadable

This commit is contained in:
Ben Sarmiento
2024-05-25 16:02:18 +02:00
parent b8c67a83cf
commit 7886ed69a2
3 changed files with 22 additions and 22 deletions

View File

@@ -61,7 +61,7 @@ func (dl *Downloader) DownloadFile(
return
}
unrestrict := torMgr.UnrestrictFileUntilOk(file)
unrestrict := torMgr.UnrestrictFileUntilOk(file, cfg.ShouldServeFromRclone())
if unrestrict == nil {
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, file.Link)
if err := file.State.Event(context.Background(), "break_file"); err != nil {
@@ -104,7 +104,7 @@ func (dl *Downloader) DownloadLink(
log *logutil.Logger,
) {
// log.Debugf("Opening file %s (%s)", fileName, link)
unrestrict := torMgr.UnrestrictLinkUntilOk(link)
unrestrict := torMgr.UnrestrictLinkUntilOk(link, cfg.ShouldServeFromRclone())
if unrestrict == nil {
log.Warnf("File %s cannot be unrestricted (link=%s)", fileName, link)
http.Error(resp, "File is not available", http.StatusInternalServerError)