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/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 3f7e410..37283a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ use tokio::{ task::JoinHandle, }; use url::Url; +use videos::display::format_video::FormatVideo; use yt_dlp::wrapper::info_json::InfoJson; use crate::{cli::Command, storage::subscriptions::get_subscriptions}; @@ -128,7 +129,16 @@ async fn main() -> Result<()> { } VideosCommand::Info { hash } => { let video = get_video_by_hash(&app, &hash.realize(&app).await?).await?; - dbg!(video); + + print!( + "{}", + (&video + .to_formatted_video(&app) + .await + .context("Failed to format video")? + .colorize()) + .to_info_display() + ); } }, Command::Update { -- cgit 1.4.1