mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-08 18:37:09 +02:00
feat(config): add EnableUserAvatarUpload flag
This commit is contained in:
parent
02c9816aec
commit
962910f0de
6 changed files with 15 additions and 0 deletions
|
|
@ -91,6 +91,7 @@ type configOptions struct {
|
|||
EnableStarRating bool
|
||||
EnableUserEditing bool
|
||||
EnableArtworkUpload bool
|
||||
EnableUserAvatarUpload bool
|
||||
MaxImageUploadSize string
|
||||
MaxImageSize string
|
||||
EnableSharing bool
|
||||
|
|
@ -1028,6 +1029,7 @@ func setViperDefaults() {
|
|||
viper.SetDefault("enablenowplaying", true)
|
||||
viper.SetDefault("uiplaybackreportinterval", consts.DefaultUIPlaybackReportInterval)
|
||||
viper.SetDefault("enableartworkupload", true)
|
||||
viper.SetDefault("enableuseravatarupload", true)
|
||||
viper.SetDefault("maximageuploadsize", consts.DefaultMaxImageUploadSize)
|
||||
viper.SetDefault("maximagesize", consts.DefaultMaxImageSize)
|
||||
viper.SetDefault("enablesharing", true)
|
||||
|
|
|
|||
|
|
@ -76,6 +76,13 @@ var _ = Describe("Configuration", func() {
|
|||
})
|
||||
})
|
||||
|
||||
Describe("user avatar upload", func() {
|
||||
It("is enabled by default", func() {
|
||||
conf.Load(true)
|
||||
Expect(conf.Server.EnableUserAvatarUpload).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("ValidateURL", func() {
|
||||
It("accepts a valid http URL", func() {
|
||||
fn := conf.ValidateURL("TestOption", "http://example.com/path")
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ const (
|
|||
I18nFolder = "i18n"
|
||||
ScanIgnoreFile = ".ndignore"
|
||||
ArtworkFolder = "artwork"
|
||||
AvatarFolder = "avatar"
|
||||
// HashedArtworkFolder is a subtree of ArtworkFolder, kept apart from the name-addressed
|
||||
// upload folders beside it so Prune's sweep never reaches them.
|
||||
HashedArtworkFolder = "hashed"
|
||||
|
|
@ -118,6 +119,7 @@ const (
|
|||
DefaultUICoverArtSize = 300
|
||||
DefaultMaxImageUploadSize = "10MB"
|
||||
DefaultMaxImageSize = "20MB"
|
||||
MaxAvatarSize = 512
|
||||
)
|
||||
|
||||
// Prometheus options
|
||||
|
|
@ -143,6 +145,7 @@ const (
|
|||
EntityArtist = "artist"
|
||||
EntityPlaylist = "playlist"
|
||||
EntityRadio = "radio"
|
||||
EntityUser = "user"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ var staticData = sync.OnceValue(func() insights.Data {
|
|||
data.Config.DefaultBackgroundURLSet = conf.Server.UILoginBackgroundURL == consts.DefaultUILoginBackgroundURL
|
||||
data.Config.EnableArtworkPrecache = conf.Server.EnableArtworkPrecache
|
||||
data.Config.EnableArtworkUpload = conf.Server.EnableArtworkUpload
|
||||
data.Config.EnableUserAvatarUpload = conf.Server.EnableUserAvatarUpload
|
||||
data.Config.CoverArtQuality = conf.Server.CoverArtQuality
|
||||
data.Config.EnableWebPEncoding = conf.Server.EnableWebPEncoding
|
||||
data.Config.UICoverArtSize = conf.Server.UICoverArtSize
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ type Data struct {
|
|||
EnableJukebox bool `json:"enableJukebox,omitempty"`
|
||||
EnablePrometheus bool `json:"enablePrometheus,omitempty"`
|
||||
EnableArtworkUpload bool `json:"enableArtworkUpload,omitempty"`
|
||||
EnableUserAvatarUpload bool `json:"enableUserAvatarUpload,omitempty"`
|
||||
CoverArtQuality int `json:"coverArtQuality,omitempty"`
|
||||
EnableWebPEncoding bool `json:"enableWebPEncoding,omitempty"`
|
||||
UICoverArtSize int `json:"uiCoverArtSize,omitempty"`
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
|
|||
"devActivityPanel": conf.Server.DevActivityPanel,
|
||||
"enableUserEditing": conf.Server.EnableUserEditing,
|
||||
"enableArtworkUpload": conf.Server.EnableArtworkUpload,
|
||||
"enableUserAvatarUpload": conf.Server.EnableUserAvatarUpload,
|
||||
"enableSharing": conf.Server.EnableSharing,
|
||||
"shareURL": conf.Server.ShareURL,
|
||||
"defaultDownloadableShare": conf.Server.DefaultDownloadableShare,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue