Compare commits
2 Commits
97046f1399
...
9fea043888
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fea043888 | ||
|
|
1cb9c325b4 |
@@ -262,6 +262,15 @@ 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()
|
||||||
|
.parse::<f32>()
|
||||||
|
.unwrap_or(0.5625)
|
||||||
|
;
|
||||||
let video_item = VideoItem::new(
|
let video_item = VideoItem::new(
|
||||||
id.to_string(),
|
id.to_string(),
|
||||||
title,
|
title,
|
||||||
@@ -274,7 +283,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