polishing

This commit is contained in:
Ben Sarmiento
2023-11-11 04:21:35 +01:00
parent aa6ce3662c
commit abf4183af5
4 changed files with 10 additions and 3 deletions

View File

@@ -39,6 +39,10 @@ func HandlePropfindRequest(w http.ResponseWriter, r *http.Request, t *torrent.To
}
if err != nil {
if strings.Contains(err.Error(), "cannot find") {
http.Error(w, "Not Found", http.StatusNotFound)
return
}
log.Errorf("Error processing request: %v", err)
http.Error(w, "Server error", http.StatusInternalServerError)
return

View File

@@ -34,8 +34,11 @@ func HandleDirectoryListing(w http.ResponseWriter, r *http.Request, t *torrent.T
http.Error(w, "Not Found", http.StatusNotFound)
return
}
if err != nil {
if strings.Contains(err.Error(), "cannot find") {
http.Error(w, "Not Found", http.StatusNotFound)
return
}
log.Errorf("Error processing request: %v", err)
http.Error(w, "Server error", http.StatusInternalServerError)
return

View File

@@ -59,7 +59,7 @@ func NewHTTPClient(token string, maxRetries int, c config.ConfigInterface) *HTTP
// no need to retry
return false
},
log: logutil.NewLogger().Named("http"),
log: logutil.NewLogger().Named("client"),
config: c,
}
}

View File

@@ -177,7 +177,7 @@ func (rd *RealDebrid) SelectTorrentFiles(id string, files string) error {
}
defer resp.Body.Close()
rd.log.Debugf("Selected files %d for torrent id=%s", len(strings.Split(files, ",")), id)
rd.log.Debugf("Started the download for torrent id=%s", len(strings.Split(files, ",")), id)
return nil
}