mirror of
https://github.com/JackDallas/Premiumizearr.git
synced 2026-01-06 04:43:46 +01:00
Make config change a breaking update
This commit is contained in:
16
config.yaml
Normal file
16
config.yaml
Normal 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: ""
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user