mirror of
https://github.com/FliegendeWurst/KIT-ILIAS-downloader.git
synced 2024-08-28 04:04:18 +00:00
Add CLI flag for forum downloading
This commit is contained in:
parent
84eda01c29
commit
6fea6f2d0f
10
src/main.rs
10
src/main.rs
@ -525,6 +525,9 @@ fn process(ilias: Arc<ILIAS>, 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<ILIAS>, 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)]
|
||||
|
Loading…
Reference in New Issue
Block a user