From 6fea6f2d0f3e54995d713dc50f7be647dd70ede8 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu@web.de> Date: Wed, 22 Apr 2020 12:21:14 +0200 Subject: [PATCH] Add CLI flag for forum downloading --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index acc8014..0156b91 100644 --- a/src/main.rs +++ b/src/main.rs @@ -525,6 +525,9 @@ fn process(ilias: Arc, path: PathBuf, obj: Object) -> impl std::future::F tokio::io::copy(&mut reader, &mut file).await.unwrap(); }, Forum { url, .. } => { + if !ilias.opt.forum { + return; + } if let Err(e) = fs::create_dir(&path) { if e.kind() != io::ErrorKind::AlreadyExists { println!("error: {:?}", e); @@ -573,6 +576,9 @@ fn process(ilias: Arc, path: PathBuf, obj: Object) -> impl std::future::F } }, Thread { url } => { + if !ilias.opt.forum { + return; + } if let Err(e) = fs::create_dir(&path) { if e.kind() != io::ErrorKind::AlreadyExists { println!("error: {:?}", e); @@ -639,6 +645,10 @@ struct Opt { /// Do not download Opencast videos #[structopt(short, long)] no_videos: bool, + + /// Download forum content + #[structopt(short = "t", long)] + forum: bool, /// Re-download already present files #[structopt(short)]