diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-08 16:59:24 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-08 16:59:24 +0100 |
commit | d387d04730a9a0f52bf5139c0bcf05d1534ec4ac (patch) | |
tree | 6db65fb9ab605553e5c572c5cc9421be3af98523 | |
parent | chore(version): v1.3.2 (diff) | |
download | yt-d387d04730a9a0f52bf5139c0bcf05d1534ec4ac.tar.gz yt-d387d04730a9a0f52bf5139c0bcf05d1534ec4ac.zip |
fix(yt/select/add): Avoid crash on adding a video
Currently, it expects the video to be already added to the database, as it requires looking up it's hash from it. Re-ordering the statements is not the cleanest solution, but it works.
-rw-r--r-- | yt/src/select/cmds.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/yt/src/select/cmds.rs b/yt/src/select/cmds.rs index db3685a..0d06bd5 100644 --- a/yt/src/select/cmds.rs +++ b/yt/src/select/cmds.rs @@ -48,11 +48,12 @@ pub async fn handle_select_cmd( entry: yt_dlp::wrapper::info_json::InfoJson, ) -> Result<()> { let video = video_entry_to_video(entry, None)?; + add_video(app, video.clone()).await?; + println!( "{}", (&video.to_formatted_video(app).await?.colorize()).to_line_display() ); - add_video(app, video).await?; Ok(()) } |