summaryrefslogtreecommitdiff
path: root/app/config.go
diff options
context:
space:
mode:
authorHeinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>2023-01-16 11:33:12 +0000
committerJames Mills <james@mills.io>2023-01-16 11:33:12 +0000
commit19a1141af3f1aa52c706e402af734797d5d929ff (patch)
tree6e50140550f92fe320b4d389d93d1b75b132fd24 /app/config.go
parent9952cc533ac093a9b8acf964642e42ae8962f768 (diff)
preserve-video-filename (#49)
This should fix issue #40 I have not made the `allowed_characters` configurable yet nor the `replacement_character`. Mostly because I couldn't decide if I should define those "globally" on a server basis, or on the library nodes. Feel free to modify, extend, rip apart. 😁 Reviewed-on: https://git.mills.io/prologic/tube/pulls/49 Co-authored-by: Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io> Co-committed-by: Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>
Diffstat (limited to 'app/config.go')
-rw-r--r--app/config.go32
1 files changed, 18 insertions, 14 deletions
diff --git a/app/config.go b/app/config.go
index 2b11688..7d886c0 100644
--- a/app/config.go
+++ b/app/config.go
@@ -17,17 +17,19 @@ type Config struct {
// PathConfig settings for media library path.
type PathConfig struct {
- Path string `json:"path"`
- Prefix string `json:"prefix"`
+ Path string `json:"path"`
+ Prefix string `json:"prefix"`
+ PreserveUploadFilename bool `json:"preserve_upload_filename,omitempty"`
}
// ServerConfig settings for App Server.
type ServerConfig struct {
- Host string `json:"host"`
- Port int `json:"port"`
- StorePath string `json:"store_path"`
- UploadPath string `json:"upload_path"`
- MaxUploadSize int64 `json:"max_upload_size"`
+ Host string `json:"host"`
+ Port int `json:"port"`
+ StorePath string `json:"store_path"`
+ UploadPath string `json:"upload_path"`
+ PreserveUploadFilename bool `json:"preserve_upload_filename,omitempty"`
+ MaxUploadSize int64 `json:"max_upload_size"`
}
// ThumbnailerConfig settings for Transcoder
@@ -68,16 +70,18 @@ func DefaultConfig() *Config {
return &Config{
Library: []*PathConfig{
&PathConfig{
- Path: "videos",
- Prefix: "",
+ Path: "videos",
+ Prefix: "",
+ PreserveUploadFilename: false,
},
},
Server: &ServerConfig{
- Host: "0.0.0.0",
- Port: 8000,
- StorePath: "tube.db",
- UploadPath: "uploads",
- MaxUploadSize: 104857600,
+ Host: "0.0.0.0",
+ Port: 8000,
+ StorePath: "tube.db",
+ UploadPath: "uploads",
+ PreserveUploadFilename: false,
+ MaxUploadSize: 104857600,
},
Thumbnailer: &ThumbnailerConfig{
Timeout: 60,