presentations don't need to create the slide at all if not in range
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Chris Cochrun 2025-10-20 15:02:00 -05:00
parent 001650a656
commit 3c1c76d41c

View file

@ -204,7 +204,14 @@ impl ServiceTrait for Presentation {
let pages = document.pages().into_diagnostic()?; let pages = document.pages().into_diagnostic()?;
debug!(?pages); debug!(?pages);
let pages: Vec<Handle> = pages let pages: Vec<Handle> = pages
.filter_map(|page| { .enumerate()
.filter_map(|(index, page)| {
if (index as i32) < starting_index {
return None;
} else if (index as i32) > ending_index {
return None;
};
let Some(page) = page.ok() else { let Some(page) = page.ok() else {
return None; return None;
}; };
@ -227,13 +234,7 @@ impl ServiceTrait for Presentation {
.collect(); .collect();
let mut slides: Vec<Slide> = vec![]; let mut slides: Vec<Slide> = vec![];
for (index, page) in pages.into_iter().enumerate() { for (index, page) in pages.into_iter() {
if (index as i32) < starting_index {
continue;
} else if (index as i32) > ending_index {
continue;
};
let slide = SlideBuilder::new() let slide = SlideBuilder::new()
.background( .background(
Background::try_from(self.path.clone()) Background::try_from(self.path.clone())