From 299df65290ef028a997bcfed888b2230ee750f36 Mon Sep 17 00:00:00 2001 From: James Mills Date: Fri, 27 Mar 2020 21:04:10 +1000 Subject: Add optional title and description to video upload --- app/app.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index bb13895..bf027e8 100644 --- a/app/app.go +++ b/app/app.go @@ -209,6 +209,9 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { } defer file.Close() + title := r.FormValue("video_title") + description := r.FormValue("video_description") + // TODO: Make collection user selectable from drop-down in Form // XXX: Assume we can put uploaded videos into the first collection (sorted) we find keys := make([]string, 0, len(a.Library.Paths)) @@ -266,6 +269,8 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { "-acodec", "aac", "-strict", "-2", "-loglevel", "quiet", + "-metadata", fmt.Sprintf("title=%s", title), + "-metadata", fmt.Sprintf("comment=%s", description), tf.Name(), ); err != nil { err := fmt.Errorf("error transcoding video: %w", err) @@ -413,8 +418,8 @@ func (a *App) importHandler(w http.ResponseWriter, r *http.Request) { "-acodec", "aac", "-strict", "-2", "-loglevel", "quiet", - "-metadata", fmt.Sprintf("title=\"%s\"", vid.Title), - "-metadata", fmt.Sprintf("description=\"%s\"", vid.Description), + "-metadata", fmt.Sprintf("title=%s", vid.Title), + "-metadata", fmt.Sprintf("comment=%s", vid.Description), tf.Name(), ); err != nil { err := fmt.Errorf("error transcoding video: %w", err) -- cgit v1.2.3