added ascpect_ratio to xfree
This commit is contained in:
@@ -262,6 +262,12 @@ impl XfreeProvider {
|
|||||||
let uploaded_at = chrono::DateTime::parse_from_rfc3339(&upload_date)
|
let uploaded_at = chrono::DateTime::parse_from_rfc3339(&upload_date)
|
||||||
.map(|dt| dt.timestamp() as u64)
|
.map(|dt| dt.timestamp() as u64)
|
||||||
.unwrap_or(0);
|
.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();
|
||||||
let video_item = VideoItem::new(
|
let video_item = VideoItem::new(
|
||||||
id.to_string(),
|
id.to_string(),
|
||||||
title,
|
title,
|
||||||
@@ -274,7 +280,8 @@ impl XfreeProvider {
|
|||||||
.preview(preview)
|
.preview(preview)
|
||||||
.tags(tags)
|
.tags(tags)
|
||||||
.uploader(uploader)
|
.uploader(uploader)
|
||||||
.uploaded_at(uploaded_at);
|
.uploaded_at(uploaded_at)
|
||||||
|
.aspect_ratio(aspect_ration);
|
||||||
items.push(video_item);
|
items.push(video_item);
|
||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
|
|||||||
Reference in New Issue
Block a user