diff options
Diffstat (limited to 'src/select/mod.rs')
-rw-r--r-- | src/select/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/select/mod.rs b/src/select/mod.rs index 2663a04..ca7a203 100644 --- a/src/select/mod.rs +++ b/src/select/mod.rs @@ -20,6 +20,7 @@ use crate::{ cli::CliArgs, constants::HELP_STR, storage::video_database::{getters::get_videos, VideoStatus}, + videos::display::format_video::FormatVideo, }; use anyhow::{bail, Context, Result}; @@ -63,23 +64,24 @@ pub async fn select(app: &App, done: bool, use_last_selection: bool) -> Result<( // Warmup the cache for the display rendering of the videos. // Otherwise the futures would all try to warm it up at the same time. if let Some(vid) = matching_videos.first() { - let _ = vid.to_select_file_display(app).await?; + let _ = vid.to_formatted_video(app).await?; } let mut edit_file = BufWriter::new(&temp_file); join_all( matching_videos - .iter() - .map(|vid| async { vid.to_select_file_display(app).await }) + .into_iter() + .map(|vid| async { vid.to_formatted_video_owned(app).await }) .collect::<Vec<_>>(), ) .await .into_iter() .try_for_each(|line| -> Result<()> { - let line = line?; + let formatted_line = (&line?).to_select_file_display(); + edit_file - .write_all(line.as_bytes()) + .write_all(formatted_line.as_bytes()) .expect("This write should not fail"); Ok(()) |