diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-27 21:04:10 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-27 21:04:10 +1000 |
| commit | 299df65290ef028a997bcfed888b2230ee750f36 (patch) | |
| tree | efb2121a68fc45e100adff16988168281d373ef8 /app/app.go | |
| parent | 9af98b0382bb8d58b12d45860afd861ec8b04cb4 (diff) | |
Add optional title and description to video upload
Diffstat (limited to 'app/app.go')
| -rw-r--r-- | app/app.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) |
