("");
+ assert!(result.is_ok(), "Error: {}", result.unwrap_err());
+}
+
#[test]
#[sealed_test(env = [("LIBREDDIT_SFW_ONLY", "on")])]
fn test_env_var() {
diff --git a/src/instance_info.rs b/src/instance_info.rs
index 9d34cd5..edf379f 100644
--- a/src/instance_info.rs
+++ b/src/instance_info.rs
@@ -131,6 +131,8 @@ impl InstanceInfo {
["Disable stats collection", &convert(&self.config.disable_stats_collection)],
["Reddit request count", &self.reddit_requests.load(SeqCst).to_string()],
["Total request count", &self.total_requests.load(SeqCst).to_string()],
+ ["Pushshift frontend", &convert(&self.config.pushshift)],
+ //TODO: fallback to crate::config::DEFAULT_PUSHSHIFT_FRONTEND
])
.with_header_row(["Settings"]),
);
@@ -167,6 +169,7 @@ impl InstanceInfo {
Disable stats collection: {:?}\n
Reddit request count: {}\n
Total request count: {}\n
+ Pushshift frontend: {:?}\n
Config:\n
Banner: {:?}\n
Hide awards: {:?}\n
@@ -190,6 +193,7 @@ impl InstanceInfo {
self.config.disable_stats_collection,
self.reddit_requests.load(SeqCst),
self.total_requests.load(SeqCst),
+ self.config.pushshift,
self.config.banner,
self.config.default_hide_awards,
self.config.default_theme,
diff --git a/src/post.rs b/src/post.rs
index 0f97b2e..98dcac3 100644
--- a/src/post.rs
+++ b/src/post.rs
@@ -1,5 +1,6 @@
// CRATES
use crate::client::json;
+use crate::config::get_setting;
use crate::server::RequestExt;
use crate::subreddit::{can_access_quarantine, quarantine};
use crate::utils::{
@@ -169,8 +170,10 @@ fn build_comment(
let body = if (val(comment, "author") == "[deleted]" && val(comment, "body") == "[removed]") || val(comment, "body") == "[ Removed by Reddit ]" {
format!(
- "",
- post_link, id
+ "",
+ get_setting("LIBREDDIT_PUSHSHIFT_FRONTEND").unwrap_or(String::from(crate::config::DEFAULT_PUSHSHIFT_FRONTEND)),
+ post_link,
+ id
)
} else {
rewrite_urls(&val(comment, "body_html"))
diff --git a/src/utils.rs b/src/utils.rs
index a084af7..5cf4b7d 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,3 +1,4 @@
+use crate::config::get_setting;
//
// CRATES
//
@@ -662,7 +663,8 @@ pub async fn parse_post(post: &serde_json::Value) -> Post {
let body = if val(post, "removed_by_category") == "moderator" {
format!(
- "",
+ "",
+ get_setting("LIBREDDIT_PUSHSHIFT_FRONTEND").unwrap_or(String::from(crate::config::DEFAULT_PUSHSHIFT_FRONTEND)),
permalink
)
} else {