presentations don't need to create the slide at all if not in range
Some checks are pending
/ test (push) Waiting to run
Some checks are pending
/ test (push) Waiting to run
This commit is contained in:
parent
001650a656
commit
3c1c76d41c
1 changed files with 9 additions and 8 deletions
|
|
@ -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())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue