From 3c801086de15dd18ce44338972cf3917d63aba8d Mon Sep 17 00:00:00 2001
From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
Date: Mon, 7 Oct 2024 19:46:47 +0200
Subject: 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.
---
 src/download/mod.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 {
-- 
cgit 1.4.1