feat: include duration in YouTube entry metadata
This commit is contained in:
+8
-1
@@ -2993,7 +2993,8 @@ fn video_channel_colors_follow_category_membership_and_preserve_selection_contra
|
||||
&serde_json::json!({
|
||||
"entries": cases.iter().map(|(channel, id, handle, _)| serde_json::json!({
|
||||
"id": "jNQXAC9IVRw", "title": "Video title", "channel": channel,
|
||||
"channel_id": id, "uploader_id": handle, "upload_date": "20261011"
|
||||
"channel_id": id, "uploader_id": handle, "upload_date": "20261011",
|
||||
"duration": 3723.5
|
||||
})).collect::<Vec<_>>()
|
||||
})
|
||||
.to_string(),
|
||||
@@ -3028,6 +3029,10 @@ fn video_channel_colors_follow_category_membership_and_preserve_selection_contra
|
||||
assert!(title.contains("Video title"));
|
||||
let date_x = row.find("2026-10-11").expect("date follows channel") as u16;
|
||||
assert!(row.contains(&format!("{label} · 2026-10-11")));
|
||||
assert!(
|
||||
row.contains(" · 1:02:03"),
|
||||
"duration is visible in metadata"
|
||||
);
|
||||
assert_eq!(buffer[(3, y - 1)].fg, Color::Reset, "title stays uncolored");
|
||||
assert_eq!(buffer[(date_x, y)].fg, Color::Reset, "date stays uncolored");
|
||||
assert!(
|
||||
@@ -5152,6 +5157,7 @@ fn modal_keys_edit_or_navigate_without_submitting_on_escape() {
|
||||
channel_id: None,
|
||||
uploader_id: None,
|
||||
timestamp: None,
|
||||
duration: None,
|
||||
publication_date: None,
|
||||
availability: None,
|
||||
},
|
||||
@@ -5162,6 +5168,7 @@ fn modal_keys_edit_or_navigate_without_submitting_on_escape() {
|
||||
channel_id: None,
|
||||
uploader_id: None,
|
||||
timestamp: None,
|
||||
duration: None,
|
||||
publication_date: None,
|
||||
availability: None,
|
||||
},
|
||||
|
||||
@@ -34,6 +34,7 @@ fn video() -> Video {
|
||||
channel_id: Some("UC4QobU6STFB0P71PMvOGN5A".into()),
|
||||
uploader_id: Some("@jawed".into()),
|
||||
timestamp: Some(1_114_300_000),
|
||||
duration: Some(19.0),
|
||||
publication_date: Some("2005-04-23".into()),
|
||||
availability: None,
|
||||
}
|
||||
@@ -66,6 +67,7 @@ fn miruro_video(episode: u32) -> Video {
|
||||
channel_id: None,
|
||||
uploader_id: None,
|
||||
timestamp: Some(1_114_300_000),
|
||||
duration: None,
|
||||
publication_date: Some("2005-04-23".into()),
|
||||
availability: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user