diff options
| author | Srxr <10549030+srxr@users.noreply.github.com> | 2021-06-08 21:22:14 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-08 23:22:14 +1000 |
| commit | e743a9a425ee3197649aa2c4996b8566bf75896d (patch) | |
| tree | 3fea1b47e2d180684cecc356b3194e1d8cae7540 /app/app.go | |
| parent | 7e3d72c24f96d33a89889b0f441b2b76367bd0e7 (diff) | |
Remove proprietary notices about video (#40)
* Make content proprietary configurable
* Update README
* Fixed a few template context bugs
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Diffstat (limited to 'app/app.go')
| -rw-r--r-- | app/app.go | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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, } |
