mediaapi/writers/download: Obtaining a file from a remote server is supported

This commit is contained in:
Robert Swain 2017-04-28 17:15:26 +02:00
parent 52b8b9b8fe
commit a24b3e7810

View file

@ -95,15 +95,7 @@ func Download(w http.ResponseWriter, req *http.Request, serverName string, media
}
contentType, contentDisposition, fileSize, filename, err := db.GetMedia(r.MediaID, r.ServerName)
if err != nil {
if strings.Compare(r.ServerName, cfg.ServerName) != 0 {
// TODO: get remote file from remote server
jsonErrorResponse(w, util.JSONResponse{
Code: 404,
JSON: jsonerror.NotFound(fmt.Sprintf("NOT YET IMPLEMENTED")),
}, logger)
return
}
if err != nil && strings.Compare(r.ServerName, cfg.ServerName) == 0 {
jsonErrorResponse(w, util.JSONResponse{
Code: 404,
JSON: jsonerror.NotFound(fmt.Sprintf("File %q does not exist", r.MediaID)),