diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-02-22 11:30:51 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-02-22 11:30:51 +0100 |
commit | f98665d992e3af91e52318e0c6e9334c891343bd (patch) | |
tree | 66f6a4d8c9a76221a3f9a917527fce0e3bd462e5 | |
parent | feat(yt/): Use concrete types in the `Video` structure (diff) | |
download | yt-f98665d992e3af91e52318e0c6e9334c891343bd.zip |
refactor(yt/description): Move to the `comments` subdirectory
-rw-r--r-- | yt/src/comments/description.rs (renamed from yt/src/description/mod.rs) | 15 | ||||
-rw-r--r-- | yt/src/main.rs | 3 |
2 files changed, 6 insertions, 12 deletions
diff --git a/yt/src/description/mod.rs b/yt/src/comments/description.rs index f31c027..e743e46 100644 --- a/yt/src/description/mod.rs +++ b/yt/src/comments/description.rs @@ -11,10 +11,7 @@ use crate::{ App, comments::output::display_fmt_and_less, - storage::video_database::{ - Video, - getters::{get_currently_playing_video, get_video_info_json}, - }, + storage::video_database::{Video, get}, unreachable::Unreachable, }; @@ -30,17 +27,15 @@ pub async fn description(app: &App) -> Result<()> { pub async fn get(app: &App) -> Result<String> { let currently_playing_video: Video = - if let Some(video) = get_currently_playing_video(app).await? { + if let Some(video) = get::currently_focused_video(app).await? { video } else { bail!("Could not find a currently playing video!"); }; - let info_json: InfoJson = get_video_info_json(¤tly_playing_video) - .await? - .unreachable( - "A currently *playing* must be cached. And thus the info.json should be available", - ); + let info_json: InfoJson = get::video_info_json(¤tly_playing_video)?.unreachable( + "A currently *playing* must be cached. And thus the info.json should be available", + ); Ok(info_json .description diff --git a/yt/src/main.rs b/yt/src/main.rs index ed24262..6106117 100644 --- a/yt/src/main.rs +++ b/yt/src/main.rs @@ -42,7 +42,6 @@ pub mod cache; pub mod comments; pub mod config; pub mod constants; -pub mod description; pub mod download; pub mod select; pub mod status; @@ -239,7 +238,7 @@ async fn main() -> Result<()> { comments::comments(&app).await?; } Command::Description {} => { - description::description(&app).await?; + comments::description(&app).await?; } } |