mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-21 21:48:21 -05:00
🚑️ fix(engine): fix the pagination code for librex
engine (#468)
This commit is contained in:
parent
0dd25aacb6
commit
2bdddaf928
@ -65,17 +65,10 @@ impl SearchEngine for LibreX {
|
|||||||
) -> Result<HashMap<String, SearchResult>, EngineError> {
|
) -> Result<HashMap<String, SearchResult>, EngineError> {
|
||||||
// Page number can be missing or empty string and so appropriate handling is required
|
// Page number can be missing or empty string and so appropriate handling is required
|
||||||
// so that upstream server recieves valid page number.
|
// so that upstream server recieves valid page number.
|
||||||
let url: String = match page {
|
let url: String = format!(
|
||||||
1 | 0 => {
|
|
||||||
format!("https://search.ahwx.org/search.php?q={query}&p=0&t=10")
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
format!(
|
|
||||||
"https://search.ahwx.org/search.php?q={query}&p={}&t=10",
|
"https://search.ahwx.org/search.php?q={query}&p={}&t=10",
|
||||||
page * 10,
|
page * 10
|
||||||
)
|
);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// initializing HeaderMap and adding appropriate headers.
|
// initializing HeaderMap and adding appropriate headers.
|
||||||
let header_map = HeaderMap::try_from(&HashMap::from([
|
let header_map = HeaderMap::try_from(&HashMap::from([
|
||||||
|
Loading…
Reference in New Issue
Block a user