mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Compare commits
1 Commits
be2c45cbdd
...
42890bc526
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42890bc526 |
@ -346,7 +346,7 @@ func startPluginManager(ctx context.Context) func() error {
|
|||||||
// TODO: Implement some struct tags to map flags to viper
|
// TODO: Implement some struct tags to map flags to viper
|
||||||
func init() {
|
func init() {
|
||||||
cobra.OnInitialize(func() {
|
cobra.OnInitialize(func() {
|
||||||
conf.InitConfig(cfgFile, true)
|
conf.InitConfig(cfgFile)
|
||||||
})
|
})
|
||||||
|
|
||||||
rootCmd.PersistentFlags().StringVarP(&cfgFile, "configfile", "c", "", `config file (default "./navidrome.toml")`)
|
rootCmd.PersistentFlags().StringVarP(&cfgFile, "configfile", "c", "", `config file (default "./navidrome.toml")`)
|
||||||
|
|||||||
@ -617,7 +617,7 @@ func init() {
|
|||||||
setViperDefaults()
|
setViperDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitConfig(cfgFile string, loadEnvVars bool) {
|
func InitConfig(cfgFile string) {
|
||||||
codecRegistry := viper.NewCodecRegistry()
|
codecRegistry := viper.NewCodecRegistry()
|
||||||
_ = codecRegistry.RegisterCodec("ini", ini.Codec{
|
_ = codecRegistry.RegisterCodec("ini", ini.Codec{
|
||||||
LoadOptions: ini.LoadOptions{
|
LoadOptions: ini.LoadOptions{
|
||||||
@ -638,12 +638,10 @@ func InitConfig(cfgFile string, loadEnvVars bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ = viper.BindEnv("port")
|
_ = viper.BindEnv("port")
|
||||||
if loadEnvVars {
|
|
||||||
viper.SetEnvPrefix("ND")
|
viper.SetEnvPrefix("ND")
|
||||||
replacer := strings.NewReplacer(".", "_")
|
replacer := strings.NewReplacer(".", "_")
|
||||||
viper.SetEnvKeyReplacer(replacer)
|
viper.SetEnvKeyReplacer(replacer)
|
||||||
viper.AutomaticEnv()
|
viper.AutomaticEnv()
|
||||||
}
|
|
||||||
|
|
||||||
err := viper.ReadInConfig()
|
err := viper.ReadInConfig()
|
||||||
if viper.ConfigFileUsed() != "" && err != nil {
|
if viper.ConfigFileUsed() != "" && err != nil {
|
||||||
|
|||||||
@ -31,7 +31,7 @@ var _ = Describe("Configuration", func() {
|
|||||||
filename := filepath.Join("testdata", "cfg."+format)
|
filename := filepath.Join("testdata", "cfg."+format)
|
||||||
|
|
||||||
// Initialize config with the test file
|
// Initialize config with the test file
|
||||||
conf.InitConfig(filename, false)
|
conf.InitConfig(filename)
|
||||||
// Load the configuration (with noConfigDump=true)
|
// Load the configuration (with noConfigDump=true)
|
||||||
conf.Load(true)
|
conf.Load(true)
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,6 @@ const SharePlayer = () => {
|
|||||||
remove: false,
|
remove: false,
|
||||||
spaceBar: true,
|
spaceBar: true,
|
||||||
volumeFade: { fadeIn: 200, fadeOut: 200 },
|
volumeFade: { fadeIn: 200, fadeOut: 200 },
|
||||||
sortableOptions: { delay: 200, delayOnTouchOnly: true },
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<ReactJkMusicPlayer
|
<ReactJkMusicPlayer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user