Fix #66
This commit is contained in:
parent
9a1733ac99
commit
971f14bb55
@ -155,6 +155,8 @@ async fn parse_comments(json: &serde_json::Value) -> Vec<Comment> {
|
|||||||
Vec::new()
|
Vec::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dbg!();
|
||||||
|
|
||||||
comments.push(Comment {
|
comments.push(Comment {
|
||||||
id: val(&comment, "id"),
|
id: val(&comment, "id"),
|
||||||
body,
|
body,
|
||||||
@ -171,7 +173,11 @@ async fn parse_comments(json: &serde_json::Value) -> Vec<Comment> {
|
|||||||
},
|
},
|
||||||
distinguished: val(&comment, "distinguished"),
|
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,
|
rel_time,
|
||||||
created,
|
created,
|
||||||
replies,
|
replies,
|
||||||
|
@ -343,7 +343,11 @@ pub async fn fetch_posts(path: &str, fallback_title: String) -> Result<(Vec<Post
|
|||||||
},
|
},
|
||||||
distinguished: val(post, "distinguished"),
|
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,
|
upvote_ratio: ratio as i64,
|
||||||
post_type,
|
post_type,
|
||||||
thumbnail: Media {
|
thumbnail: Media {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user