mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-04 20:30:37 +00:00
Basic gallery support (#103)
This commit is contained in:
parent
2a475d127a
commit
cf45d53fdd
4 changed files with 68 additions and 4 deletions
|
@ -72,7 +72,7 @@ async fn parse_post(json: &serde_json::Value) -> Post {
|
|||
let ratio: f64 = post["data"]["upvote_ratio"].as_f64().unwrap_or(1.0) * 100.0;
|
||||
|
||||
// Determine the type of media along with the media URL
|
||||
let (post_type, media) = media(&post["data"]).await;
|
||||
let (post_type, media, gallery) = media(&post["data"]).await;
|
||||
|
||||
// Build a post using data parsed from Reddit post API
|
||||
Post {
|
||||
|
@ -124,6 +124,7 @@ async fn parse_post(json: &serde_json::Value) -> Post {
|
|||
rel_time,
|
||||
created,
|
||||
comments: format_num(post["data"]["num_comments"].as_i64().unwrap_or_default()),
|
||||
gallery,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue