From cf0d1e25913f8e619abe5c6eefc3bbed0f743b6a Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Wed, 3 Nov 2021 23:39:51 +0100 Subject: [PATCH] Unset album_id as mandatory in photo::add and set it as unsorted if not provided Signed-off-by: Louis Vallat --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 58bdc0c..309b072 100644 --- a/src/main.rs +++ b/src/main.rs @@ -158,7 +158,6 @@ async fn main() -> Result<(), Box> { SubCommand::with_name("add_photo") .about("Add some picture to a lychee instance.") .arg(Arg::with_name("album_id") - .required(true) .long("album_id") .short("a") .help("The album id to add the picture to.") @@ -224,7 +223,7 @@ async fn main() -> Result<(), Box> { let pass = m.value_of("password").unwrap_or(""); set_public_album(&client, &lychee_session_cookie, i, p, v, d, s, f, n, pass).await; } else if let Some(m) = matches.subcommand_matches("add_photo") { - let a = m.value_of("album_id").unwrap(); + let a = m.value_of("album_id").unwrap_or("0"); let i = m.value_of("photo_path").unwrap(); println!("{}", add_photo(&client, &lychee_session_cookie, a, i).await); } else {