mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Better API to filter books in a library.
Instead of having a single method `listBooksIds` that tries to be exhaustive about all the filter and sort option, split the method in two separated methods `filter` and `sort`. The `filter` method takes a `Filter` object that represent on what we are filtering. This object has to be construct before calling `filter`. ```cpp Filter filter; filter.query("Astring"); filter.acceptTags({"nopic"}); // return all book in eng and with "Astring" in the tile or description". library.filter(filter); //equivalent to library.listBooksIds(ALL, UNSORTED, "Astring", "", "", "", {"nopic"}); // or better library.filter(Filter().query("Astring").acceptTags({"nopic"})); ``` The method `listBooksIds` has been marked as deprecated. Add a small test on the library.
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
|
||||
|
||||
tests = [
|
||||
'parseUrl'
|
||||
'parseUrl',
|
||||
'library'
|
||||
]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user