Make config change a breaking update

This commit is contained in:
Jack Dallas
2022-04-12 20:13:53 +01:00
parent 1893a1a5e4
commit e8e93c667f
2 changed files with 16 additions and 32 deletions

16
config.yaml Normal file
View File

@@ -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: ""

View File

@@ -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"`
@@ -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