Skip to content

Commit

Permalink
Fix crossposted galleries not working (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: Butter Cat <[email protected]>
  • Loading branch information
LucifersCircle and ButteredCats authored Dec 16, 2024
1 parent 1be41c5 commit 1198001
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ impl Media {
// If this post contains a gallery of images
gallery = GalleryMedia::parse(&data["gallery_data"]["items"], &data["media_metadata"]);

("gallery", &data["url"], None)
} else if data["crosspost_parent_list"][0]["is_gallery"].as_bool().unwrap_or_default() {
// If this post contains a gallery of images
gallery = GalleryMedia::parse(
&data["crosspost_parent_list"][0]["gallery_data"]["items"],
&data["crosspost_parent_list"][0]["media_metadata"],
);

("gallery", &data["url"], None)
} else if data["is_reddit_media_domain"].as_bool().unwrap_or_default() && data["domain"] == "i.redd.it" {
// If this post contains a reddit media (image) URL.
Expand Down

0 comments on commit 1198001

Please sign in to comment.