Skip to content

Commit

Permalink
Merge pull request #99 from Stremio/refactor/serialize-library-pagina…
Browse files Browse the repository at this point in the history
…tion

Library pagination
  • Loading branch information
elpiel authored Feb 29, 2024
2 parents 253cc61 + 07ccc14 commit ee2dafc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions src/model/serialize_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ mod model {
pub struct Selectable<'a> {
pub types: Vec<SelectableType<'a>>,
pub sorts: Vec<SelectableSort<'a>>,
pub prev_page: Option<SelectablePage>,
pub next_page: Option<SelectablePage>,
pub next_page: bool,
}
#[derive(Serialize)]
pub struct LibraryWithFilters<'a> {
Expand Down Expand Up @@ -91,18 +90,7 @@ pub fn serialize_library<F>(
.into_web_deep_links(),
})
.collect(),
prev_page: library.selectable.prev_page.as_ref().map(|prev_page| {
model::SelectablePage {
deep_links: LibraryDeepLinks::from((&root, &prev_page.request))
.into_web_deep_links(),
}
}),
next_page: library.selectable.next_page.as_ref().map(|next_page| {
model::SelectablePage {
deep_links: LibraryDeepLinks::from((&root, &next_page.request))
.into_web_deep_links(),
}
}),
next_page: library.selectable.next_page.is_some(),
},
catalog: library
.catalog
Expand Down

0 comments on commit ee2dafc

Please sign in to comment.