Session 3: Radarr/Sonarr/Lidarr clients with add-on-search
Adds internal/arr with a shared HTTP layer and per-service clients that look up candidates and POST the chosen one back with monitored=true and search-on-add enabled. Lidarr requires metadata_profile_id, now part of ArrConfig and validated when lidarr is set.
This commit is contained in:
@@ -40,6 +40,8 @@ type ArrConfig struct {
|
||||
APIKey string `yaml:"api_key"`
|
||||
QualityProfileID int `yaml:"quality_profile_id"`
|
||||
RootFolder string `yaml:"root_folder"`
|
||||
// MetadataProfileID is required by Lidarr; ignored by Radarr/Sonarr.
|
||||
MetadataProfileID int `yaml:"metadata_profile_id"`
|
||||
}
|
||||
|
||||
func Load(path string) (*Config, error) {
|
||||
@@ -108,6 +110,9 @@ func (c *Config) validate() error {
|
||||
return fmt.Errorf("services.%s.quality_profile_id is required when service is set", name)
|
||||
}
|
||||
}
|
||||
if c.Services.Lidarr != nil && c.Services.Lidarr.MetadataProfileID == 0 {
|
||||
return fmt.Errorf("services.lidarr.metadata_profile_id is required when lidarr is set")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user