summaryrefslogtreecommitdiff
path: root/app/app.go
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2020-03-31 19:04:21 +1000
committerJames Mills <prologic@shortcircuit.net.au>2020-03-31 19:19:58 +1000
commitcd574192bf9438691ad07c09cb157de74cada5e1 (patch)
tree31414fbf4431930b936ab3c1c2cf1bffeac2a875 /app/app.go
parent7c919b5f9b85a9f1f708884565f12b83ad4038e0 (diff)
Allow transcoding to smaller sizes a configurable and optional feature
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/app/app.go b/app/app.go
index 387adc8..7e492b3 100644
--- a/app/app.go
+++ b/app/app.go
@@ -28,15 +28,6 @@ import (
//go:generate rice embed-go
-var (
- SizeMap = map[string]string{
- "hd720": "720p",
- "hd480": "480p",
- "nhd": "360p",
- "film": "240p",
- }
-)
-
// App represents main application.
type App struct {
Config *Config
@@ -327,7 +318,7 @@ func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) {
// TODO: Make this a background job
// Resize for lower quality options
- for size, suffix := range SizeMap {
+ for size, suffix := range a.Config.Transcoder.Sizes {
log.
WithField("size", size).
WithField("vf", filepath.Base(vf)).
@@ -518,7 +509,7 @@ func (a *App) importHandler(w http.ResponseWriter, r *http.Request) {
// TODO: Make this a background job
// Resize for lower quality options
- for size, suffix := range SizeMap {
+ for size, suffix := range a.Config.Transcoder.Sizes {
log.
WithField("size", size).
WithField("vf", filepath.Base(vf)).