fix: update default setting for removing default feeds

This commit is contained in:
Matthew Esposito 2025-02-26 13:17:08 -05:00
parent efcf2fc24c
commit 35688e4af7
3 changed files with 11 additions and 0 deletions

View file

@ -76,6 +76,9 @@
},
"REDLIB_FULL_URL": {
"required": false
},
"REDLIB_DEFAULT_REMOVE_DEFAULT_FEEDS": {
"required": false
}
}
}

View file

@ -109,6 +109,9 @@ pub struct Config {
#[serde(rename = "REDLIB_FULL_URL")]
pub(crate) full_url: Option<String>,
#[serde(rename = "REDLIB_DEFAULT_REMOVE_DEFAULT_FEEDS")]
pub(crate) default_remove_default_feeds: Option<String>,
}
impl Config {
@ -156,6 +159,7 @@ impl Config {
pushshift: parse("REDLIB_PUSHSHIFT_FRONTEND"),
enable_rss: parse("REDLIB_ENABLE_RSS"),
full_url: parse("REDLIB_FULL_URL"),
default_remove_default_feeds: parse("REDLIB_DEFAULT_REMOVE_DEFAULT_FEEDS"),
}
}
}
@ -185,6 +189,7 @@ fn get_setting_from_config(name: &str, config: &Config) -> Option<String> {
"REDLIB_PUSHSHIFT_FRONTEND" => config.pushshift.clone(),
"REDLIB_ENABLE_RSS" => config.enable_rss.clone(),
"REDLIB_FULL_URL" => config.full_url.clone(),
"REDLIB_DEFAULT_REMOVE_DEFAULT_FEEDS" => config.default_remove_default_feeds.clone(),
_ => None,
}
}

View file

@ -128,6 +128,7 @@ impl InstanceInfo {
["Pushshift frontend", &convert(&self.config.pushshift)],
["RSS enabled", &convert(&self.config.enable_rss)],
["Full URL", &convert(&self.config.full_url)],
["Remove default feeds", &convert(&self.config.default_remove_default_feeds)],
//TODO: fallback to crate::config::DEFAULT_PUSHSHIFT_FRONTEND
])
.with_header_row(["Settings"]),
@ -169,6 +170,7 @@ impl InstanceInfo {
Pushshift frontend: {:?}\n
RSS enabled: {:?}\n
Full URL: {:?}\n
Remove default feeds: {:?}\n
Config:\n
Banner: {:?}\n
Hide awards: {:?}\n
@ -195,6 +197,7 @@ impl InstanceInfo {
self.config.sfw_only,
self.config.enable_rss,
self.config.full_url,
self.config.default_remove_default_feeds,
self.config.pushshift,
self.config.banner,
self.config.default_hide_awards,