From 632f5d3ebee79dfb1fb2e9c4c768c51b0a114259 Mon Sep 17 00:00:00 2001 From: Butter Cat Date: Tue, 15 Oct 2024 18:08:47 -0400 Subject: [PATCH] Fix crossposted galleries not working --- src/utils.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index 6f977754..22b7c4b6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -225,6 +225,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.