implement preload_max_filesize, preload_max_filecount options

This commit is contained in:
yggverse 2025-06-16 01:59:22 +03:00
parent 7de77b8575
commit 4f39dc3d0a
4 changed files with 78 additions and 16 deletions

View file

@ -49,7 +49,8 @@ pub struct Argument {
#[arg(long, default_value_t = false)]
pub enable_upload: bool,
/// Preload files match regex pattern (list only without preload by default)
/// Preload only files match regex pattern (list only without preload by default)
/// * see also `preload_max_filesize`, `preload_max_filecount` options
///
/// ## Example:
///
@ -62,6 +63,14 @@ pub struct Argument {
#[arg(long)]
pub preload_regex: Option<String>,
/// Max size sum of preloaded files per torrent (match `preload_regex`)
#[arg(long)]
pub preload_max_filesize: Option<u64>,
/// Max count of preloaded files per torrent (match `preload_regex`)
#[arg(long)]
pub preload_max_filecount: Option<usize>,
/// Save resolved torrent files to the `storage` location
#[arg(long, default_value_t = true)]
pub save_torrents: bool,