aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-04 13:38:51 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-04 13:38:51 +0100
commita506544a748bbbb133fbe3743a686878d9fbcef1 (patch)
treeb2b9ff2ffe2d2b1657cae23c896d6bbcaa2050fa /base
parentd97a15045d76f73002084c1e09d453e987f7c19b (diff)
downloadjellything-a506544a748bbbb133fbe3743a686878d9fbcef1.tar
jellything-a506544a748bbbb133fbe3743a686878d9fbcef1.tar.bz2
jellything-a506544a748bbbb133fbe3743a686878d9fbcef1.tar.zst
jellyfin search
Diffstat (limited to 'base')
-rw-r--r--base/src/database.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/src/database.rs b/base/src/database.rs
index 3c8bef4..90e42b9 100644
--- a/base/src/database.rs
+++ b/base/src/database.rs
@@ -286,7 +286,7 @@ impl Database {
drop(nodes);
Ok(i)
}
- pub fn search(&self, query: &str, page: usize) -> Result<(usize, Vec<NodeID>)> {
+ pub fn search(&self, query: &str, limit: usize, offset: usize) -> Result<(usize, Vec<NodeID>)> {
let query = QueryParser::for_index(
&self.text_search.index,
vec![self.text_search.title, self.text_search.description],
@@ -295,7 +295,7 @@ impl Database {
.context("parsing query")?;
let searcher = self.text_search.reader.searcher();
- let sres = searcher.search(&query, &TopDocs::with_limit(32).and_offset(page * 32))?;
+ let sres = searcher.search(&query, &TopDocs::with_limit(limit).and_offset(offset))?;
let scount = searcher.search(&query, &Count)?;
let mut results = Vec::new();