X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi_crud%2Fsrc%2Fpost%2Fupdate.rs;h=3f3e0c2a0537fe97a60ec95c4a65c043bbbf977e;hb=339eab01fd6baee187a041742a4b76827f353946;hp=285a08b55277cfc178912f4cc5ff71d3bc48ff20;hpb=9a458d2e4bc6efced4d00095cdf7a8852bc53505;p=lemmy.git diff --git a/crates/api_crud/src/post/update.rs b/crates/api_crud/src/post/update.rs index 285a08b5..3f3e0c2a 100644 --- a/crates/api_crud/src/post/update.rs +++ b/crates/api_crud/src/post/update.rs @@ -69,11 +69,11 @@ impl PerformCrud for EditPost { // Fetch post links and Pictrs cached image let data_url = data.url.as_ref(); - let (metadata_res, pictrs_thumbnail) = + let (metadata_res, thumbnail_url) = fetch_site_data(context.client(), &context.settings(), data_url).await; - let (embed_title, embed_description, embed_html) = metadata_res - .map(|u| (u.title, u.description, u.html)) - .unwrap_or((None, None, None)); + let (embed_title, embed_description, embed_video_url) = metadata_res + .map(|u| (u.title, u.description, u.embed_video_url)) + .unwrap_or_default(); let post_form = PostForm { creator_id: orig_post.creator_id.to_owned(), @@ -85,8 +85,8 @@ impl PerformCrud for EditPost { updated: Some(naive_now()), embed_title, embed_description, - embed_html, - thumbnail_url: pictrs_thumbnail.map(|u| u.into()), + embed_video_url, + thumbnail_url, ..PostForm::default() };