Removed the need for use_ssl to indicate SSL usage; instead just use the ssl_cert_path

Added the ability to specify either host/port, or uri for configuring Radarr
This commit is contained in:
2024-11-05 18:16:01 -07:00
parent 650c9783a6
commit 9936ce1ab5
7 changed files with 114 additions and 73 deletions
+16 -7
View File
@@ -2261,15 +2261,24 @@ impl<'a, 'b> Network<'a, 'b> {
let RadarrConfig {
host,
port,
uri,
api_token,
use_ssl,
..
ssl_cert_path,
} = &app.config.radarr;
let protocol = if *use_ssl { "https" } else { "http" };
let uri = format!(
"{protocol}://{host}:{}/api/v3{resource}",
port.unwrap_or(7878)
);
let uri = if let Some(radarr_uri) = uri {
format!("{radarr_uri}/api/v3{resource}")
} else {
let protocol = if ssl_cert_path.is_some() {
"https"
} else {
"http"
};
let host = host.as_ref().unwrap();
format!(
"{protocol}://{host}:{}/api/v3{resource}",
port.unwrap_or(7878)
)
};
RequestProps {
uri,