Add a libraries command and scan subcommand

This commit is contained in:
Marc Plano-Lesay 2024-11-17 15:31:12 +01:00
parent 2eb4e391c2
commit af1af8dce1
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
9 changed files with 182 additions and 1 deletions

View file

@ -9,13 +9,14 @@ mod tests {
}
use crate::args::Commands;
use args::{AssetsCommands, PeopleCommands, ServerCommands};
use args::{AssetsCommands, LibrariesCommands, PeopleCommands, ServerCommands};
use clap::Parser;
use color_eyre::eyre::{Result, WrapErr};
use color_eyre::Section;
use commands::delete_assets::delete_assets;
use commands::list_assets::list_assets;
use commands::missing_date_of_birth::missing_date_of_birth;
use commands::scan_libraries::scan_libraries;
use commands::server_features::server_features;
use commands::server_version::server_version;
use commands::sync_date_of_birth::sync_date_of_birth;
@ -79,6 +80,9 @@ async fn main() -> Result<()> {
AssetsCommands::Delete { offline } => delete_assets(ctx, *offline).await,
AssetsCommands::List { offline } => list_assets(ctx, *offline).await,
},
Commands::Libraries { libraries_command } => match libraries_command {
LibrariesCommands::Scan {} => scan_libraries(ctx).await,
},
Commands::People { people_command } => match people_command {
PeopleCommands::MissingDateOfBirths {} => missing_date_of_birth(ctx).await,
PeopleCommands::SyncDateOfBirths { vcard: _ } => {