Skip to content

Commit

Permalink
Update existing configs
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDallas committed May 15, 2022
1 parent 35dd81c commit 8c3d0dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func loadConfigFromDisk() (Config, error) {
return config, ErrInvalidConfigFile
}

config = versionUpdateConfig(config)

data, err := yaml.Marshal(config)
if err == nil {
//Save config to disk to add missing fields
Expand All @@ -70,6 +72,15 @@ func loadConfigFromDisk() (Config, error) {
return config, nil
}

func versionUpdateConfig(config Config) Config {
// 1.1.3
if config.SimultaneousDownloads == 0 {
config.SimultaneousDownloads = 5
}

return config
}

func createDefaultConfig() error {
config := Config{
PremiumizemeAPIKey: "xxxxxxxxx",
Expand Down

0 comments on commit 8c3d0dc

Please sign in to comment.