Skip to content

Commit

Permalink
Make config change a breaking update
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDallas committed Apr 12, 2022
1 parent 00bf4e1 commit c80fc31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
16 changes: 16 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PremiumizemeAPIKey: xxxxxxxxx
Arrs:
- Name: ""
URL: http://localhost:8989
APIKey: xxxxxxxxx
Type: Sonarr
- Name: ""
URL: http://localhost:7878
APIKey: xxxxxxxxx
Type: Radarr
BlackholeDirectory: ""
DownloadsDirectory: ""
UnzipDirectory: ""
bindIP: 0.0.0.0
bindPort: "8182"
WebRoot: ""
32 changes: 0 additions & 32 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ type ArrConfig struct {
type Config struct {
PremiumizemeAPIKey string `yaml:"PremiumizemeAPIKey"`

//@deprecated
SonarrURL string `yaml:"SonarrURL"`
//@deprecated
SonarrAPIKey string `yaml:"SonarrAPIKey"`
//@deprecated
RadarrURL string `yaml:"RadarrURL"`
//@deprecated
RadarrAPIKey string `yaml:"RadarrAPIKey"`

Arrs []ArrConfig `yaml:"Arrs"`

BlackholeDirectory string `yaml:"BlackholeDirectory"`
Expand All @@ -68,29 +59,6 @@ func loadConfigFromDisk() (Config, error) {
return config, ErrInvalidConfigFile
}

// Move sonarr and radarr details to the new array
if config.SonarrURL != "" && config.SonarrAPIKey != "" {
config.Arrs = append(config.Arrs, ArrConfig{
Name: "Sonarr (Imported)",
URL: config.SonarrURL,
APIKey: config.SonarrAPIKey,
Type: Sonarr,
})
config.SonarrURL = ""
config.SonarrAPIKey = ""
}

if config.RadarrURL != "" && config.RadarrAPIKey != "" {
config.Arrs = append(config.Arrs, ArrConfig{
Name: "Radarr (Imported)",
URL: config.RadarrURL,
APIKey: config.RadarrAPIKey,
Type: Radarr,
})
config.RadarrURL = ""
config.RadarrAPIKey = ""
}

data, err := yaml.Marshal(config)
if err == nil {
//Save config to disk to add missing fields
Expand Down

0 comments on commit c80fc31

Please sign in to comment.