fix: cli: print video ID when logging errors

This commit is contained in:
ThetaDev 2024-07-29 18:06:35 +02:00
parent 72b5dfec69
commit 2c7a3fb5cc
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6

View file

@ -334,7 +334,7 @@ async fn download_video(
}
let res = q.download().await;
if let Err(e) = res {
tracing::error!("{e}")
tracing::error!("[{id}]: {e}")
}
}
@ -379,6 +379,7 @@ async fn download_videos(
.for_each_concurrent(parallel, |video| {
let dl = dl.clone();
let main = main.clone();
let id = &video.id;
let mut q = target.apply(dl.download_entity(video));
if let Some(player_type) = player_type {
@ -387,7 +388,7 @@ async fn download_videos(
async move {
if let Err(e) = q.download().await {
tracing::error!("{e:?}");
tracing::error!("[{id}]: {e}");
} else {
main.inc(1);
}