Implement sheet listings with relm4 factory

This commit is contained in:
2024-02-02 21:11:21 +01:00
parent 6a6e1d03df
commit 9069138255
7 changed files with 126 additions and 117 deletions

View File

@@ -39,16 +39,16 @@ async fn main() {
debug!("Validating sheets from database...");
let validation_result = validate_sheet_files(sheets, &cli.directory);
debug!("{}", validation_result.get_stats());
for updated in validation_result.updated_sheets {
for updated in validation_result.updated_sheets.iter() {
database.update_sheet_path(updated).await.unwrap();
}
let app = RelmApp::new("de.frajul.sheet-organizer");
// Pass empty command line args to allow my own parsing
app.with_args(Vec::new()).run::<AppModel>(cli.directory);
app.with_args(Vec::new()).run::<AppModel>(validation_result);
}
struct FileValidationResult {
pub struct FileValidationResult {
validated_sheets: Vec<Sheet>,
invalidated_sheets: Vec<Sheet>,
updated_sheets: Vec<Sheet>,