mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-14 14:02:50 +00:00
Replace Responsive Feature with Secure
This commit is contained in:
parent
ace21b21d5
commit
dad01749e6
3 changed files with 7 additions and 2 deletions
|
@ -86,9 +86,11 @@ async fn subreddit(sub: &String) -> Result<Subreddit, &'static str> {
|
|||
// Otherwise, grab the JSON output from the request
|
||||
let res = req.unwrap();
|
||||
|
||||
// Metadata regarding the subreddit
|
||||
let members = res["data"]["subscribers"].as_u64().unwrap_or(0);
|
||||
let active = res["data"]["accounts_active"].as_u64().unwrap_or(0);
|
||||
|
||||
// Fetch subreddit icon either from the community_icon or icon_img value
|
||||
let community_icon: &str = res["data"]["community_icon"].as_str().unwrap().split("?").collect::<Vec<&str>>()[0];
|
||||
let icon = if community_icon.is_empty() {
|
||||
val(&res, "icon_img").await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue