From e743a9a425ee3197649aa2c4996b8566bf75896d Mon Sep 17 00:00:00 2001 From: Srxr <10549030+srxr@users.noreply.github.com> Date: Tue, 8 Jun 2021 21:22:14 +0800 Subject: Remove proprietary notices about video (#40) * Make content proprietary configurable * Update README * Fixed a few template context bugs Co-authored-by: James Mills --- app/app.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index 33e5846..783cd7f 100644 --- a/app/app.go +++ b/app/app.go @@ -188,11 +188,13 @@ func (a *App) indexHandler(w http.ResponseWriter, r *http.Request) { ctx := &struct { Sort string Quality string + Config *Config Playing *media.Video Playlist media.Playlist }{ Sort: sort, Quality: quality, + Config: a.Config, Playing: &media.Video{ID: ""}, Playlist: a.Library.Playlist(), } @@ -204,8 +206,12 @@ func (a *App) indexHandler(w http.ResponseWriter, r *http.Request) { // HTTP handler for /upload func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { - ctx := map[string]interface{}{ - "MAX_UPLOAD_SIZE": a.Config.Server.MaxUploadSize, + ctx := &struct { + Config *Config + Playing *media.Video + }{ + Config: a.Config, + Playing: &media.Video{ID: ""}, } a.render("upload", w, ctx) } else if r.Method == "POST" { @@ -566,11 +572,13 @@ func (a *App) pageHandler(w http.ResponseWriter, r *http.Request) { ctx := &struct { Sort string Quality string + Config *Config Playing *media.Video Playlist media.Playlist }{ Sort: sort, Quality: quality, + Config: a.Config, Playing: &media.Video{ID: ""}, Playlist: a.Library.Playlist(), } @@ -621,11 +629,13 @@ func (a *App) pageHandler(w http.ResponseWriter, r *http.Request) { ctx := &struct { Sort string Quality string + Config *Config Playing *media.Video Playlist media.Playlist }{ Sort: sort, Quality: quality, + Config: a.Config, Playing: playing, Playlist: playlist, } -- cgit v1.2.3