Fix #66
This commit is contained in:
parent
9a1733ac99
commit
971f14bb55
2 changed files with 12 additions and 2 deletions
|
@ -155,6 +155,8 @@ async fn parse_comments(json: &serde_json::Value) -> Vec<Comment> {
|
|||
Vec::new()
|
||||
};
|
||||
|
||||
dbg!();
|
||||
|
||||
comments.push(Comment {
|
||||
id: val(&comment, "id"),
|
||||
body,
|
||||
|
@ -171,7 +173,11 @@ async fn parse_comments(json: &serde_json::Value) -> Vec<Comment> {
|
|||
},
|
||||
distinguished: val(&comment, "distinguished"),
|
||||
},
|
||||
score: format_num(score),
|
||||
score: if comment["data"]["score_hidden"].as_bool().unwrap_or_default() {
|
||||
"•".to_string()
|
||||
} else {
|
||||
format_num(score)
|
||||
},
|
||||
rel_time,
|
||||
created,
|
||||
replies,
|
||||
|
|
|
@ -343,7 +343,11 @@ pub async fn fetch_posts(path: &str, fallback_title: String) -> Result<(Vec<Post
|
|||
},
|
||||
distinguished: val(post, "distinguished"),
|
||||
},
|
||||
score: format_num(score),
|
||||
score: if post["data"]["hide_score"].as_bool().unwrap_or_default() {
|
||||
"•".to_string()
|
||||
} else {
|
||||
format_num(score)
|
||||
},
|
||||
upvote_ratio: ratio as i64,
|
||||
post_type,
|
||||
thumbnail: Media {
|
||||
|
|
Loading…
Reference in a new issue