diff options
Diffstat (limited to '')
-rw-r--r-- | src/select/selection_file/display.rs | 10 | ||||
-rw-r--r-- | src/update/mod.rs | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/select/selection_file/display.rs b/src/select/selection_file/display.rs index 0a0ce96..23c39d0 100644 --- a/src/select/selection_file/display.rs +++ b/src/select/selection_file/display.rs @@ -69,7 +69,10 @@ impl Video { Ok(f) } - pub fn to_color_display(&self) -> String { + pub async fn to_color_display_owned(self, app: &App) -> Result<String> { + self.to_color_display(app).await + } + pub async fn to_color_display(&self, app: &App) -> Result<String> { let mut f = String::new(); let publish_date = if let Some(date) = self.publish_date { @@ -89,8 +92,9 @@ impl Video { write!( f, - r#"{} {} {} {} {}"#, + r#"{} {} {} {} {} {}"#, c!("31;1", self.status.as_command()), + c!("95;3", self.extractor_hash.into_short_hash(app).await?), c!("32;1", self.title.replace(['"', '„', '”'], "'")), c!("37;1", publish_date), c!("34;1", parent_subscription_name), @@ -98,6 +102,6 @@ impl Video { ) .expect("This write should always work"); - f + Ok(f) } } diff --git a/src/update/mod.rs b/src/update/mod.rs index 0e47321..ce31c7b 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -47,6 +47,7 @@ pub async fn update( 2 => 20, // logging.INFO 3.. => 10, // logging.DEBUG }; + info!("Passing log_level {} to the update script", log_level); let mut urls: Vec<String> = vec![]; for (name, sub) in subscriptions.0 { @@ -216,7 +217,7 @@ async fn process_subscription( url, }; - println!("{}", video.to_color_display()); + println!("{}", video.to_color_display(app).await?); add_video(app, video).await?; Ok(()) } |