aboutsummaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-05-02 10:47:16 +0200
committerGitHub <noreply@github.com>2022-05-02 10:47:16 +0200
commit979a551f1e2aeb9f3417df5e52a7279230b7a3ba (patch)
tree69815c9823d0c58ceec1cf3dbbb56a1ce484660e /setup
parentbfa344e83191c49bdc9917ab7a8ec31b93c202e9 (diff)
Return `null` if MaxFileSizeBytes is 0 (#2409)
* Return "null" if MaxFileSizeBytes is 0 * Add comment and nil check (better save than sorry) * Simplify config
Diffstat (limited to 'setup')
-rw-r--r--setup/config/config_mediaapi.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/setup/config/config_mediaapi.go b/setup/config/config_mediaapi.go
index 9a7d8496..c85020d2 100644
--- a/setup/config/config_mediaapi.go
+++ b/setup/config/config_mediaapi.go
@@ -23,7 +23,7 @@ type MediaAPI struct {
// The maximum file size in bytes that is allowed to be stored on this server.
// Note: if max_file_size_bytes is set to 0, the size is unlimited.
// Note: if max_file_size_bytes is not set, it will default to 10485760 (10MB)
- MaxFileSizeBytes *FileSizeBytes `yaml:"max_file_size_bytes,omitempty"`
+ MaxFileSizeBytes FileSizeBytes `yaml:"max_file_size_bytes,omitempty"`
// Whether to dynamically generate thumbnails on-the-fly if the requested resolution is not already generated
DynamicThumbnails bool `yaml:"dynamic_thumbnails"`
@@ -48,7 +48,7 @@ func (c *MediaAPI) Defaults(generate bool) {
c.BasePath = "./media_store"
}
- c.MaxFileSizeBytes = &DefaultMaxFileSizeBytes
+ c.MaxFileSizeBytes = DefaultMaxFileSizeBytes
c.MaxThumbnailGenerators = 10
}
@@ -61,7 +61,7 @@ func (c *MediaAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
checkNotEmpty(configErrs, "media_api.database.connection_string", string(c.Database.ConnectionString))
checkNotEmpty(configErrs, "media_api.base_path", string(c.BasePath))
- checkPositive(configErrs, "media_api.max_file_size_bytes", int64(*c.MaxFileSizeBytes))
+ checkPositive(configErrs, "media_api.max_file_size_bytes", int64(c.MaxFileSizeBytes))
checkPositive(configErrs, "media_api.max_thumbnail_generators", int64(c.MaxThumbnailGenerators))
for i, size := range c.ThumbnailSizes {