diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-06-13 20:59:07 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-06-13 20:59:07 +0200 |
commit | b70dd458615bbad99cf05dbde3dc831a9922ba21 (patch) | |
tree | 561113fb3d6f82469aaafd9dc08e0c7b7f308895 | |
parent | feat({yt_dlp,yt}): Migrate from pyo3 to rustpython (diff) | |
download | yt-b70dd458615bbad99cf05dbde3dc831a9922ba21.zip |
fix(yt/{se,}dowa): Don't exit completely, if the downloader fails
Otherwise the `yt watch` part exists even if videos are available to be watched.
-rw-r--r-- | yt/src/main.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/yt/src/main.rs b/yt/src/main.rs index 413dc5e..093d0e1 100644 --- a/yt/src/main.rs +++ b/yt/src/main.rs @@ -230,15 +230,17 @@ async fn dowa(arc_app: Arc<App>) -> Result<()> { info!("Max cache size: '{}'", max_cache_size); let arc_app_clone = Arc::clone(&arc_app); - let download: JoinHandle<Result<()>> = tokio::spawn(async move { - download::Downloader::new() + let download: JoinHandle<()> = tokio::spawn(async move { + let result = download::Downloader::new() .consume(arc_app_clone, max_cache_size.as_u64()) - .await?; + .await; - Ok(()) + if let Err(err) = result { + error!("Error from downloader: {err:?}"); + } }); watch::watch(arc_app).await?; - download.await??; + download.await?; Ok(()) } |