about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-07 19:46:47 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-07 19:46:47 +0200
commit3c801086de15dd18ce44338972cf3917d63aba8d (patch)
treea99cf42fa8170fedea99f632791c176e4531ea41
parentstyle(python_update/raw_update.py): Format (diff)
downloadyt-3c801086de15dd18ce44338972cf3917d63aba8d.tar.gz
yt-3c801086de15dd18ce44338972cf3917d63aba8d.zip
fix(downloader): Don't display changed cache size on first run
Currently, the "Can't download video ..." message is directly followed
by the "Current cache size has changed ...", when a full cache was hit
before. This avoids this duplicated message, by update the cached cache
size.
-rw-r--r--src/download/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/download/mod.rs b/src/download/mod.rs
index 51f1a66..56910f9 100644
--- a/src/download/mod.rs
+++ b/src/download/mod.rs
@@ -27,7 +27,7 @@ use futures::{future::BoxFuture, FutureExt};
 use log::{debug, error, info, warn};
 use tokio::{fs, task::JoinHandle, time};
 
-mod download_options;
+pub mod download_options;
 
 #[derive(Debug)]
 pub struct CurrentDownload {
@@ -124,6 +124,7 @@ impl Downloader {
                     next_video.title, Bytes::new(video_size), Bytes::new(cache_allocation), Bytes::new(max_cache_size)
                     );
                 self.printed_warning = true;
+                self.cached_cache_allocation = Some(cache_allocation);
             }
             if let Some(cca) = self.cached_cache_allocation {
                 if cca != cache_allocation {