Repair optimizations
This commit is contained in:
@@ -81,7 +81,8 @@ 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.Link = "@"
|
||||
file.ForRepair = true
|
||||
t.SetChecksum("") // force a recheck
|
||||
streamErrorVideo("https://www.youtube.com/watch?v=gea_FJrtFVA", w, r, t, c, log)
|
||||
} else {
|
||||
@@ -126,7 +127,8 @@ 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.Link = "@"
|
||||
file.ForRepair = true
|
||||
torMgr.SetChecksum("") // force a recheck
|
||||
}
|
||||
streamErrorVideo("https://www.youtube.com/watch?v=FSSd8cponAA", w, r, torMgr, cfg, log)
|
||||
@@ -137,7 +139,8 @@ 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.Link = "@"
|
||||
file.ForRepair = true
|
||||
torMgr.SetChecksum("") // force a recheck
|
||||
}
|
||||
streamErrorVideo("https://www.youtube.com/watch?v=BcseUxviVqE", w, r, torMgr, cfg, log)
|
||||
|
||||
Reference in New Issue
Block a user