Improve image URL extraction logic to support various image content types

This commit is contained in:
암냥 2026-01-15 06:20:36 +09:00
commit 8c61d94219
No known key found for this signature in database

View file

@ -43,7 +43,9 @@ pub fn extract_image_url(item: &Entry) -> Option<String> {
// 첫 번째로 media:content에서 이미지 찾기
item.media
.iter()
.find(|m| m.content.iter().any(|c| c.medium.as_deref() == Some("image")))
.find(|m| m.content.iter().any(|c| {
c.content_type.as_deref().map_or(false, |ct| ct.starts_with("image/"))
}))
.and_then(|m| m.content.first())
.and_then(|c| c.url.clone())
.map(|url| url.to_string())