From b83dfc5da6424fce7bda8c551303cc5bd91447e3 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Sun, 8 Mar 2026 08:33:47 +0300 Subject: Allow skipping downloads This streamlines testing. --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 00e38a5..c7de6ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,9 +23,9 @@ struct Args { /// Path to the cookies.json file. #[arg(long, default_value = "cookies.json")] cookies: String, - /// Do not delete the log file on success. - #[arg(long = "preserve-log")] - preserve_log: bool, + /// Do not download files. Use if they were already downloaded in a previous run. + #[arg(long = "skip-download")] + skip_download: bool, } /// Fetches EPUB structural data (like the chapters URL). @@ -117,7 +117,9 @@ async fn main() -> Result<()> { let dest_root = format!("Books/{}/epub_root", args.bookid); let dest_root = Path::new(&dest_root); - download_all_files(&client, &file_entries, dest_root).await?; + if !args.skip_download { + download_all_files(&client, &file_entries, dest_root).await?; + } let epub_path = format!("Books/{0}/{0}.epub", args.bookid); let epub_path = Path::new(&epub_path); create_epub_archive(&epub_data, dest_root, epub_path, &file_entries, &chapters)?; -- cgit v1.2.3-70-g09d2