Respect excluded files in output step counts and processing validation

- Output step now shows only included (non-excluded) image count and size
- Navigate-to-step refresh accounts for exclusions
- Process action checks for included images, not just loaded files
This commit is contained in:
2026-03-06 13:31:35 +02:00
parent a74010a121
commit 819ac963de
2 changed files with 13 additions and 5 deletions

View File

@@ -97,15 +97,20 @@ pub fn build_output_page(state: &AppState) -> adw::NavigationPage {
.title("Batch Info")
.build();
let file_count = state.loaded_files.borrow().len();
let total_size: u64 = state.loaded_files.borrow().iter()
let excluded = state.excluded_files.borrow();
let files = state.loaded_files.borrow();
let included_count = files.iter().filter(|p| !excluded.contains(*p)).count();
let total_size: u64 = files.iter()
.filter(|p| !excluded.contains(*p))
.filter_map(|p| std::fs::metadata(p).ok())
.map(|m| m.len())
.sum();
drop(files);
drop(excluded);
let count_row = adw::ActionRow::builder()
.title("Images to process")
.subtitle(format!("{} images ({})", file_count, format_size(total_size)))
.subtitle(format!("{} images ({})", included_count, format_size(total_size)))
.build();
count_row.add_prefix(&gtk::Image::from_icon_name("image-x-generic-symbolic"));