Allow to retain repair status and unselect status
This commit is contained in:
@@ -93,7 +93,7 @@ func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *i
|
||||
|
||||
resp := t.UnrestrictUntilOk(link)
|
||||
if resp == nil {
|
||||
log.Warnf("File %s is no longer available", filepath.Base(file.Path))
|
||||
log.Warnf("File %s is no longer available, file is marked for repair", filepath.Base(file.Path))
|
||||
file.Link = "repair"
|
||||
t.SetChecksum("") // force a recheck
|
||||
gf.playErrorVideo("https://www.youtube.com/watch?v=gea_FJrtFVA", w, r, t, c, log)
|
||||
@@ -140,7 +140,7 @@ func (gf *GetFile) streamFileToResponse(file *intTor.File, url string, w http.Re
|
||||
resp, err := gf.client.Do(req)
|
||||
if err != nil {
|
||||
if file != nil {
|
||||
log.Warnf("Cannot download file %s: %v", file.Path, err)
|
||||
log.Warnf("Cannot download file %s, file is marked for repair: %v", file.Path, err)
|
||||
file.Link = "repair"
|
||||
torMgr.SetChecksum("") // force a recheck
|
||||
}
|
||||
@@ -151,7 +151,7 @@ func (gf *GetFile) streamFileToResponse(file *intTor.File, url string, w http.Re
|
||||
|
||||
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)
|
||||
log.Warnf("Received a %s status code for file %s, file is marked for repair", resp.Status, file.Path)
|
||||
file.Link = "repair"
|
||||
torMgr.SetChecksum("") // force a recheck
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user