fix(services/january): remove image if video present and hence fix logic error
refactor(services/january): throw an error if embed fails to generate
This commit is contained in:
@@ -156,8 +156,13 @@ pub async fn create_website_embed(original_url: &str, document: &str) -> Option<
|
||||
}
|
||||
}
|
||||
|
||||
// remove image if video exists
|
||||
if metadata.video.is_some() {
|
||||
metadata.image.take();
|
||||
}
|
||||
|
||||
// fetch image size if missing
|
||||
if metadata.special.is_none() && metadata.image.is_none() {
|
||||
if metadata.special.is_none() {
|
||||
if let Some(Image {
|
||||
width, height, url, ..
|
||||
}) = &metadata.image
|
||||
|
||||
Reference in New Issue
Block a user