Skip to content

Support paging of figgy born ephemera - εφήμερα objects#3239

Merged
christinach merged 2 commits into
mainfrom
3230-ephemera-index
Apr 27, 2026
Merged

Support paging of figgy born ephemera - εφήμερα objects#3239
christinach merged 2 commits into
mainfrom
3230-ephemera-index

Conversation

@christinach
Copy link
Copy Markdown
Member

@christinach christinach commented Apr 27, 2026

related to [#3230]

@christinach
Copy link
Copy Markdown
Member Author

Indexed ephemera on catalog-staging figgy ephemera count: 390
in figgy I'm seeing figgy ephemera project complete state count: 391. Currenlty I'm not sure which object is not being indexed. I can review this in another Pr.
I would like with this Pr to support the paging and index ephemera in the catalog.

@christinach christinach marked this pull request as ready for review April 27, 2026 17:22
Copy link
Copy Markdown
Member

@sandbergja sandbergja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @christinach ! Two questions/suggestions -- neither one is a blocker


#[derive(Deserialize, Debug)]
pub struct Pages {
// pub current_page: Option<u32>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could remove these commented-out fields?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes I'm sorry !

.map(|m| m.pages.total_pages)
.unwrap_or(1);

all_ids.extend(response.data.into_iter().map(|item| item.id));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since response.data.into_iter().map(|item| item.id)) is repeated multiple times, do you think it would be worth it to pull it out as a method in an impl block for the FoldersResponse struct?

page_number += 1;

let response = client.get_folder_data(page_number).await?;
all_ids.extend(response.data.into_iter().map(|item| item.id));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@christinach christinach requested a review from sandbergja April 27, 2026 17:52
@christinach
Copy link
Copy Markdown
Member Author

@sandbergja thanks for reviewing can you please check again?

Copy link
Copy Markdown
Member

@sandbergja sandbergja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @christinach ! Looks great! 🐬

I had some (non-blocking) suggestions about the signature of the new method, otherwise looks great!

Comment on lines +12 to +19
pub fn response_ids(
response: FoldersResponse,
) -> std::iter::Map<
std::vec::IntoIter<BornDigitalCollection>,
impl FnMut(BornDigitalCollection) -> String,
> {
response.data.into_iter().map(|item| item.id)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two ideas to simplify the signature a bit:

  • If we use &self, we can replace FoldersResponse::response_ids(response) with response.response_ids below
  • We don't necessarily have to be as specific about the return type
Suggested change
pub fn response_ids(
response: FoldersResponse,
) -> std::iter::Map<
std::vec::IntoIter<BornDigitalCollection>,
impl FnMut(BornDigitalCollection) -> String,
> {
response.data.into_iter().map(|item| item.id)
}
pub fn response_ids(
&self
) -> impl Iterator<Item=String>
{
self.data.into_iter().map(|item| item.id.clone())
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandbergja thanks I will open a new Pr with your suggestion

@christinach christinach merged commit 8830123 into main Apr 27, 2026
10 checks passed
@christinach christinach deleted the 3230-ephemera-index branch April 27, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants