Compare commits

...

2 Commits

Author SHA1 Message Date
Simon
9fea043888 fixed aspect ratio 2026-03-08 21:32:12 +00:00
Simon
1cb9c325b4 added ascpect_ratio to xfree 2026-03-08 21:31:30 +00:00

View File

@@ -262,6 +262,15 @@ impl XfreeProvider {
let uploaded_at = chrono::DateTime::parse_from_rfc3339(&upload_date)
.map(|dt| dt.timestamp() as u64)
.unwrap_or(0);
let aspect_ration = post
.get("media")
.and_then(|v| v.get("aspectRatio"))
.and_then(|v| v.as_str())
.unwrap_or_default()
.to_string()
.parse::<f32>()
.unwrap_or(0.5625)
;
let video_item = VideoItem::new(
id.to_string(),
title,
@@ -274,7 +283,8 @@ impl XfreeProvider {
.preview(preview)
.tags(tags)
.uploader(uploader)
.uploaded_at(uploaded_at);
.uploaded_at(uploaded_at)
.aspect_ratio(aspect_ration);
items.push(video_item);
}
return items;