mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Got rid of legacy OPDS API usage in kiwix-serve
This commit is contained in:
@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
function queryUrlBuilder() {
|
||||
let url = `${root}/catalog/search?`;
|
||||
let url = `${root}/catalog/v2/entries?`;
|
||||
url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&");
|
||||
params.forEach((value, key) => {url+= value ? `&${key}=${value}` : ''});
|
||||
return (url);
|
||||
@ -267,7 +267,7 @@
|
||||
}
|
||||
|
||||
async function getBookCount(query) {
|
||||
const url = `${root}/catalog/search?${query}`;
|
||||
const url = `${root}/catalog/v2/entries?${query}&count=0`;
|
||||
return await fetch(url).then(async (resp) => {
|
||||
const data = new window.DOMParser().parseFromString(await resp.text(), 'application/xml');
|
||||
return parseInt(data.querySelector('totalResults').innerHTML);
|
||||
|
Reference in New Issue
Block a user