From 145a776039248a9460e9473e4bc9ef3d533b60c1 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 14 Oct 2024 12:32:23 +0200 Subject: feat(videos): Provide a consistent display for the `Video` struct Before, `Video`s where colourized differently, just because the colourization was not standardized. It now is. --- src/select/cmds.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/select/cmds.rs') diff --git a/src/select/cmds.rs b/src/select/cmds.rs index b45cc48..6e71607 100644 --- a/src/select/cmds.rs +++ b/src/select/cmds.rs @@ -19,6 +19,7 @@ use crate::{ VideoOptions, VideoStatus, }, update::video_entry_to_video, + videos::display::format_video::FormatVideo, }; use anyhow::{bail, Context, Result}; @@ -57,7 +58,10 @@ pub async fn handle_select_cmd( entry: yt_dlp::wrapper::info_json::InfoJson, ) -> Result<()> { let video = video_entry_to_video(entry, None)?; - println!("{}", video.to_color_display(app).await?); + println!( + "{}", + (&video.to_formatted_video(app).await?.colorize()).to_line_display() + ); add_video(app, video).await?; Ok(()) -- cgit 1.4.1