mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
Correctly get the bookIds to the opdsfeed.
We want to have LOCAL and REMOTE and VALID files.
This commit is contained in:
parent
fd4f228a41
commit
f691f85724
@ -686,12 +686,15 @@ static struct MHD_Response* handle_catalog(RequestContext* request)
|
|||||||
opdsDumper.setRootLocation(rootLocation);
|
opdsDumper.setRootLocation(rootLocation);
|
||||||
opdsDumper.setSearchDescriptionUrl("catalog/searchdescription.xml");
|
opdsDumper.setSearchDescriptionUrl("catalog/searchdescription.xml");
|
||||||
opdsDumper.setId(kiwix::to_string(uuid));
|
opdsDumper.setId(kiwix::to_string(uuid));
|
||||||
|
opdsDumper.setLibrary(&library);
|
||||||
mimeType = "application/atom+xml;profile=opds-catalog;kind=acquisition; charset=utf-8";
|
mimeType = "application/atom+xml;profile=opds-catalog;kind=acquisition; charset=utf-8";
|
||||||
std::vector<std::string> bookIdsToDump;
|
std::vector<std::string> bookIdsToDump;
|
||||||
if (url == "root.xml") {
|
if (url == "root.xml") {
|
||||||
opdsDumper.setTitle("All zims");
|
opdsDumper.setTitle("All zims");
|
||||||
uuid = zim::Uuid::generate(host);
|
uuid = zim::Uuid::generate(host);
|
||||||
bookIdsToDump = library.getBooksIds();
|
|
||||||
|
bookIdsToDump = library.listBooksIds(
|
||||||
|
kiwix::VALID|kiwix::LOCAL|kiwix::REMOTE);
|
||||||
} else if (url == "search") {
|
} else if (url == "search") {
|
||||||
std::string query;
|
std::string query;
|
||||||
try {
|
try {
|
||||||
@ -701,12 +704,14 @@ static struct MHD_Response* handle_catalog(RequestContext* request)
|
|||||||
}
|
}
|
||||||
opdsDumper.setTitle("Search result for " + query);
|
opdsDumper.setTitle("Search result for " + query);
|
||||||
uuid = zim::Uuid::generate();
|
uuid = zim::Uuid::generate();
|
||||||
bookIdsToDump = library.filter(query);
|
bookIdsToDump = library.listBooksIds(
|
||||||
|
kiwix::VALID|kiwix::LOCAL|kiwix::REMOTE,
|
||||||
|
kiwix::UNSORTED,
|
||||||
|
query);
|
||||||
} else {
|
} else {
|
||||||
return build_404(request, "");
|
return build_404(request, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
opdsDumper.setLibrary(&library);
|
|
||||||
content = opdsDumper.dumpOPDSFeed(bookIdsToDump);
|
content = opdsDumper.dumpOPDSFeed(bookIdsToDump);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user