0081b4d8e7
Make the limit of zim files per search configurable.
...
The default value is 0, which means no limit.
2022-06-02 12:37:52 +02:00
077ceac5a5
Make the search_rendered handle multizim search.
...
This introduce a intermediate mustache object to store information
about the request made by the user.
2022-06-02 12:22:28 +02:00
854623618c
Use the newly introduced searcherCache for multizim searcher.
2022-06-02 12:22:25 +02:00
f5af0633ec
Move the searcher cache into the Library
2022-05-24 14:55:48 +02:00
28fb76bbc2
Remove m_readers in Library::impl
...
It is a deprecated interface and it is a simple wrapper on Archive.
2022-05-24 14:55:48 +02:00
f0dd34b6db
Introduce buildQueryData helper in SearchRenderer
2022-05-23 19:13:25 +02:00
090c2fd31a
Move LibraryBase out of public API.
...
We use composition instead of inheritance to implement Library.
2022-05-23 10:56:39 +02:00
cc3545ac3b
fixup! Readd a SearchRenderer
constructor without Library
argument.
2022-03-04 17:07:41 +01:00
ec18eb40ea
Readd a SearchRenderer
constructor without Library
argument.
...
Adding the library argument breaks the API. It is better to add
another constructor to not have to create another major version.
2022-02-25 15:46:13 +01:00
cb2226c11f
Fix library.h include
2022-02-17 10:56:46 +01:00
58be502f3f
add book titles to search results
2022-02-16 12:50:18 +01:00
261adf0ef9
Add method to change MHD_OPTION_PER_IP_CONNECTION_LIMIT
...
Adds new method setIpConnectionLimit() to server.
Default is 0 (infinite)
2022-02-05 18:31:42 +05:30
84587e7f03
Add a new private constructor not deprecated for Reader.
...
As we still create a `Reader` in the deprecated code of `Library`,
we need a way to create a reader without raising a deprecated warning.
So we create a another constructor with a dummy argument and we use it.
2022-01-18 12:22:11 +01:00
fcd865bb81
Revert removing of deprecated methods used by android wrapper.
2022-01-14 12:28:50 +01:00
e5eeb08206
Remove old deprecated methods.
2022-01-13 14:23:29 +01:00
ac6f91798f
Assume SuggestionItem
has a public constructor.
...
`SuggestionItem` is somehow a simple container.
2022-01-13 14:23:29 +01:00
e5d26a4699
Deprecate SearchRenderer
creation from a Searcher
.
2022-01-13 14:23:29 +01:00
3d64a9d9a9
Deprecate Searcher
creation.
...
As the `Searcher` is now deprecated, we also remove the unit tests on it.
`Searcher` is now untested, and so it reduces the code coverage.
2022-01-13 14:23:29 +01:00
fb7d9f02c8
Deprecate Reader
creation.
...
As we `Reader` is now deprecated, we also remove the unit tests on it.
`Reader` is now untested, and so it reduces the code coverage.
2022-01-13 14:23:29 +01:00
96e0d15ab4
Deprecate Entry
creation.
...
As the `Entry` is still created by `Reader` we need a way to create a
entry without raising a deprecated warning.
To do so we create a second constructor with a dummy argument.
This second constructor is private and is not marked as deprecated so we
can use it.
2022-01-13 14:23:29 +01:00
39732e2bcf
Deprecate methods on Book.
...
- `update(const Reader& reader)` is replaced by
`update(const zim::Archive& archive)`
- `getFavicon*()` is replaced by `getIllustration(48)->*`
2022-01-12 18:07:46 +01:00
aa50845e22
Fix small typos in comments
2022-01-09 20:05:30 +01:00
3dbcbe542b
Add tests for kiwix::fileExists and kiwix::fileReadable
2022-01-10 00:18:44 +05:30
854058f842
Introduce kiwix::fileReadable
...
kiwix::fileExists only checks for file existence now
kiwix::fileReadable will check if the file is readable (implicitly checking for file existence also)
2022-01-05 20:16:38 +05:30
9482bfb95b
Add a method to get the a book illustration for a specific size.
2022-01-04 14:16:46 +01:00
f36d8e9851
New kiwix::getVersions() and printVersions()
2022-01-02 12:22:11 +01:00
9554ab5db0
Make getNetworkInterfaces() and getBestPublicIp() available via tools.h
...
Remove HTTP URL helper line - should be done in kiwix-serve
Add getters at server level - getAddress and getPort
2021-12-22 22:38:16 +05:30
405ea29900
Added Library::addOrUpdateBook() alias
2021-11-30 18:20:27 +04:00
7161db8e2a
Manager::reload() also removes books from Library
2021-11-30 18:20:27 +04:00
262e13845c
Enter Library::removeBooksNotUpdatedSince()
2021-11-30 18:20:27 +04:00
473d2d2a69
Introduced Library::getBookByIdThreadSafe()
2021-11-30 18:20:27 +04:00
02b9e32d18
Library became almost thread-safe
...
Library became thread-safe with the exception of `getBookById()`
and `getBookByPath()` methods - thread safety in those accessors is
rendered meaningless by their return type (they return a reference
to a book which can be removed any time later by another thread).
2021-11-30 18:20:27 +04:00
c2927ce6f7
Library got a yet unused mutex
...
Introducing a mutex in `Library` necessitates manually implementing the
move constructor and assignment operator. It's better to still delegate
that work to the compiler to eliminate any possibility of bugs when new
data members are added to `Library`. The trick is to move the data into
an auxiliary class `LibraryBase` and derive `Library` from it.
2021-11-30 18:20:27 +04:00
b712c732f2
Dropped Library::getBookBy*() non-const functions
2021-11-30 18:20:27 +04:00
298247ca9b
Renamed NameMapperProxy -> UpdatableNameMapper
2021-11-30 18:20:27 +04:00
3aeeeeee76
Manager::reload()
2021-11-30 18:20:27 +04:00
226dac2604
LibraryManipulator is now merely a notifier
...
Originally `LibraryManipulator` was an abstract class completely decoupled
from `Library`. Its `addBookToLibrary()` and `addBookmarkToLibrary()`
methods could be defined in an arbitrary way. Now `LibraryManipulator` has to be
bound to a library object, those methods are no longer virtual, they always
update the library and allow for some additional actions via virtual
functions `bookWasAddedToLibrary()` and `bookmarkWasAddedToLibrary()`.
2021-11-30 18:20:27 +04:00
76a5e3a877
Library::addBook() updates the reader cache
2021-11-30 18:20:27 +04:00
6199c11505
NameMapperProxy respects the withAlias flag
2021-11-30 18:18:16 +04:00
8fffa59974
Added NameMapperProxy from kiwix/kiwix-desktop#714
...
The right place for NameMapperProxy introduced by kiwix/kiwix-desktop#714 is in
libkiwix (so that it can be reused in kiwix-serve).
2021-11-30 18:18:16 +04:00
5f3c34ed93
NameMapper's API is now const
2021-11-22 21:06:27 +04:00
571e417d1e
Manager is now safe to copy
2021-11-20 20:38:39 +04:00
913a368a12
Made Manager's ctors explicit
2021-11-20 20:34:13 +04:00
4a01081e83
Thread-safe Book::Illustration::getData()
2021-11-19 16:44:25 +04:00
eb6a0d6456
Enter Book::getIllustrations()
2021-11-18 14:39:00 +04:00
9f42884507
Book's illustrations are now immutable
2021-11-18 14:39:00 +04:00
8a6adddc16
Non-throwing Book::getDefaultIllustration()
2021-11-18 14:39:00 +04:00
c8da5eea2b
Dropped Book::getMutableDefaultIllustration()
...
Now a Book is created without a default illustration.
2021-11-18 14:38:00 +04:00
f4bc3c8ced
Book::Illustration got dimensions
2021-11-18 14:34:51 +04:00
5263f6880c
Internally Book supports multiple illustrations
2021-11-18 14:34:51 +04:00