Allow to retain repair status and unselect status

This commit is contained in:
Ben Sarmiento
2023-11-26 11:57:50 +01:00
parent 7b4e0d97a1
commit c715a4a833
2 changed files with 4 additions and 7 deletions

View File

@@ -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
}