diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/app.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -234,6 +234,13 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { return } + 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) |
