about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-02 15:31:20 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-02 15:33:43 +0100
commitfc9cd7a887e5f6863111cce154557873680cd0bb (patch)
tree34ab137418167c7796bf4ab696bfc1beef3c1e53
parentchore(version): v1.3.1 (diff)
downloadyt-fc9cd7a887e5f6863111cce154557873680cd0bb.tar.gz
yt-fc9cd7a887e5f6863111cce154557873680cd0bb.zip
fix(yt/download): Don't trust the `cache_path` attribute
-rw-r--r--yt/src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt/src/main.rs b/yt/src/main.rs
index d4cd2b6..2049183 100644
--- a/yt/src/main.rs
+++ b/yt/src/main.rs
@@ -17,7 +17,7 @@ use std::{collections::HashMap, fs, sync::Arc};
 use anyhow::{bail, Context, Result};
 use app::App;
 use bytes::Bytes;
-use cache::invalidate;
+use cache::{invalidate, maintain};
 use clap::Parser;
 use cli::{CacheCommand, CheckCommand, SelectCommand, SubscriptionCommand, VideosCommand};
 use config::Config;
@@ -96,6 +96,7 @@ async fn main() -> Result<()> {
                 max_cache_size.unwrap_or(app.config.download.max_cache_size.as_u64());
             info!("Max cache size: '{}'", Bytes::new(max_cache_size));
 
+            maintain(&app, false).await?;
             if force {
                 invalidate(&app, true).await?;
             }