Delete if everything is unselected

This commit is contained in:
Ben Sarmiento
2023-11-21 14:16:53 +01:00
parent 0f336c15df
commit 48ad2bc3bf
6 changed files with 36 additions and 22 deletions

View File

@@ -81,8 +81,7 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *intTor.TorrentM
resp := t.UnrestrictUntilOk(link)
if resp == nil {
log.Warnf("File %s is no longer available", file.Path)
file.Link = "@"
file.ForRepair = true
file.Link = "repair"
t.SetChecksum("") // force a recheck
streamErrorVideo("https://www.youtube.com/watch?v=gea_FJrtFVA", w, r, t, c, log)
} else {
@@ -127,8 +126,7 @@ func streamFileToResponse(file *intTor.File, url string, w http.ResponseWriter,
if err != nil {
if file != nil {
log.Warnf("Cannot download file %s: %v", file.Path, err)
file.Link = "@"
file.ForRepair = true
file.Link = "repair"
torMgr.SetChecksum("") // force a recheck
}
streamErrorVideo("https://www.youtube.com/watch?v=FSSd8cponAA", w, r, torMgr, cfg, log)
@@ -139,8 +137,7 @@ func streamFileToResponse(file *intTor.File, url string, w http.ResponseWriter,
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent {
if file != nil {
log.Warnf("Received a %s status code for file %s", resp.Status, file.Path)
file.Link = "@"
file.ForRepair = true
file.Link = "repair"
torMgr.SetChecksum("") // force a recheck
}
streamErrorVideo("https://www.youtube.com/watch?v=BcseUxviVqE", w, r, torMgr, cfg, log)