Add a libraries command and scan subcommand
This commit is contained in:
parent
2eb4e391c2
commit
af1af8dce1
9 changed files with 182 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
pub mod delete_assets;
|
||||
pub mod list_assets;
|
||||
pub mod missing_date_of_birth;
|
||||
pub mod scan_libraries;
|
||||
pub mod server_features;
|
||||
pub mod server_version;
|
||||
pub mod sync_date_of_birth;
|
||||
|
|
17
src/commands/scan_libraries.rs
Normal file
17
src/commands/scan_libraries.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use color_eyre::eyre::Result;
|
||||
use log::*;
|
||||
|
||||
use crate::actions::action::Action;
|
||||
use crate::actions::scan_library::ScanLibrary;
|
||||
use crate::{actions::fetch_all_libraries::FetchAllLibraries, context::Context};
|
||||
|
||||
pub async fn scan_libraries(ctx: Context) -> Result<()> {
|
||||
let libraries = FetchAllLibraries::new(()).execute(&ctx).await?;
|
||||
|
||||
for library in libraries {
|
||||
debug!("Scanning {}", library.name);
|
||||
ScanLibrary::new(library).execute(&ctx).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue