mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Support multiple content folders. Closes #2
This commit is contained in:
@@ -54,13 +54,6 @@ func initConfig() {
|
||||
viper.AddConfigPath("$HOME/.stash") // Look for the config in the home directory
|
||||
viper.AddConfigPath(".") // Look for config in the working directory
|
||||
|
||||
viper.SetDefault(config.Database, paths.GetDefaultDatabaseFilePath())
|
||||
|
||||
// Set generated to the metadata path for backwards compat
|
||||
if !viper.IsSet(config.Generated) {
|
||||
viper.SetDefault(config.Generated, viper.GetString(config.Metadata))
|
||||
}
|
||||
|
||||
err := viper.ReadInConfig() // Find and read the config file
|
||||
if err != nil { // Handle errors reading the config file
|
||||
_ = utils.Touch(paths.GetDefaultConfigFilePath())
|
||||
@@ -69,6 +62,11 @@ func initConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
viper.SetDefault(config.Database, paths.GetDefaultDatabaseFilePath())
|
||||
|
||||
// Set generated to the metadata path for backwards compat
|
||||
viper.SetDefault(config.Generated, viper.GetString(config.Metadata))
|
||||
|
||||
// Watch for changes
|
||||
viper.WatchConfig()
|
||||
viper.OnConfigChange(func(e fsnotify.Event) {
|
||||
|
||||
Reference in New Issue
Block a user