diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-22 18:31:24 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-22 18:31:24 +1000 |
| commit | a7e88fbcac4fef0c193bcf5b9cc4046ab0a385de (patch) | |
| tree | ed174980e8a74432f19f7c7907c00dd33b48936c | |
| parent | e2381cc2abadca1ab86ffbec9a2e475943c192ab (diff) | |
Remove direct library add after upload as Rename(s) are not atomic on some file systems
| -rw-r--r-- | app/app.go | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -240,13 +240,6 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { os.Rename(tf.Name(), of) os.Remove(fn) - if err := a.Library.Add(of); err != nil { - err := fmt.Errorf("error adding new video: %w", err) - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - fmt.Fprintf(w, "Video successfully uploaded!") } else { http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed) |
