about summary refs log tree commit diff stats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-14 12:32:23 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-14 12:34:56 +0200
commit145a776039248a9460e9473e4bc9ef3d533b60c1 (patch)
tree7b2a948ae1f08335eba477c26bf1d5e83cdac24b /src/main.rs
parentfix(downloader): Don't display changed cache size on first run (diff)
downloadyt-145a776039248a9460e9473e4bc9ef3d533b60c1.tar.gz
yt-145a776039248a9460e9473e4bc9ef3d533b60c1.zip
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.
Diffstat (limited to '')
-rw-r--r--src/main.rs12
1 files changed, 11 insertions, 1 deletions
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 {