add series support
This commit is contained in:
parent
6a79f0c1ed
commit
a91fe9a0bb
11 changed files with 183 additions and 43 deletions
|
@ -57,20 +57,10 @@ impl Author {
|
|||
conn: &Connection,
|
||||
sort_name: &str,
|
||||
) -> Result<bool, DataStoreError> {
|
||||
let mut stmt = conn
|
||||
.prepare("SELECT Count(1) FROM authors WHERE sort < (:sort_name) ORDER BY sort DESC")?;
|
||||
let params = named_params! { ":sort_name": sort_name };
|
||||
let count: u64 = stmt.query_row(params, |x| x.get(0))?;
|
||||
|
||||
Ok(count > 0)
|
||||
Pagination::has_prev_or_more(conn, "authors", sort_name, &SortOrder::DESC)
|
||||
}
|
||||
|
||||
pub fn has_more_authors(conn: &Connection, sort_name: &str) -> Result<bool, DataStoreError> {
|
||||
let mut stmt = conn
|
||||
.prepare("SELECT Count(1) FROM authors WHERE sort > (:sort_name) ORDER BY sort ASC")?;
|
||||
let params = named_params! { ":sort_name": sort_name };
|
||||
let count: u64 = stmt.query_row(params, |x| x.get(0))?;
|
||||
|
||||
Ok(count > 0)
|
||||
Pagination::has_prev_or_more(conn, "authors", sort_name, &SortOrder::ASC)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue