From eba9db5be52a83e4e94207b0237957eb353ddfff Mon Sep 17 00:00:00 2001 From: Heinrich 'Henrik' Langos Date: Sat, 21 Jan 2023 00:59:27 +0000 Subject: [PATCH] fix: Fix initial rendering of import page (#63) Without this, the GET request on the `import` function will fail. Reviewed-on: https://git.mills.io/prologic/tube/pulls/63 Co-authored-by: Heinrich 'Henrik' Langos Co-committed-by: Heinrich 'Henrik' Langos --- app/app.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 9d0828b..1b1afe5 100644 --- a/app/app.go +++ b/app/app.go @@ -427,7 +427,13 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { // HTTP handler for /import func (a *App) importHandler(w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { - ctx := &struct{}{} + ctx := &struct { + Config *Config + Playing *media.Video + }{ + Config: a.Config, + Playing: &media.Video{ID: ""}, + } a.render("import", w, ctx) } else if r.Method == "POST" { r.ParseMultipartForm(1024)