rel="self" on a book entry misused the Atom/OPDS convention (which
normally names the feed/entry's own URL, not a local file path).
Local-path links are now written and parsed as
rel="http://opds-spec.org/acquisition/open-access" as well, with the
href's shape (absolute URL vs. path) telling readers which is which -
an entry may carry one of each.
readOpds() previously required callers to separately derive a host
string and a library path. Replace them with a single contentOriginUri
parameter, letting resolveContentOrigin() fully determine both
urlHost and baseDir from it based on whether it looks like a URL or a
local filesystem path.
Introduce a ContentOrigin struct and a resolveContentOrigin() helper
that will let readOpds() take a single contentOriginUri parameter
instead of separate urlHost/libraryPath ones. As a first step, wire
readOpds()'s body to use resolveContentOrigin() to derive baseDir from
libraryPath (replacing parseOpdsDom()'s internal
removeLastPathElement() call), while urlHost is still passed through
untouched.
This is not yet functional as a single-parameter API: readOpds()'s
public signature and callers are unchanged, and the urlHost side of
resolveContentOrigin() isn't exercised yet. That follows in the next
commit.
Manager::readOpds() gains a libraryPath parameter, resolved to a
baseDir via removeLastPathElement() and passed to
Book::updateFromOpds() so a rel="self" link in a library file read
via readFile() resolves relative to that file's own directory - the
OPDS analogue of readXml()'s existing "path" attribute handling.
Mirrors updateFromXml()'s handling of the "path" attribute: if an OPDS
entry carries a <link rel="self" href="..."/>, resolve it (against
baseDir, when relative) into Book::m_path/m_pathValid. baseDir defaults
to "" so existing callers are unaffected until they start passing a
real value.
The doc described params readOnly/libraryPath which do not exist on
readOpds() (leftover from a copy-paste of readXml()'s doc), and never
mentioned the actual urlHost parameter.
Also removed a comment in tets case that was refering to a class that was removed in previous branches.
Documentation of libkiwix API has been largely neglected. This commit
documents the Server API having to do with the functionality fixed in
the previous commit.
The path parameter of the SpellingsDB constructor has been changed to
denote the path of the cache directory where spellings databases for
different ZIM archive should be stored. The filename of the spellings
database is generated from the ZIM archive UUID and the current version
of the spellings database implementation.
- Restored kiwix::getNetworkInterfaces() API to the version before
support for IPv6 was introduced
- Renamed the new API method to kiwix::getNetworkInterfacesIPv4Or6()
`MigrationMode` was kind of defined in the context of an internal mode
used by `migrateBookmark(...)`.
But now, with `getBestTargetBookId`, it is broken.
This commit fix that and the associated implementation.
Now `UPGRADE_ONLY` will make `getBestTargetBookId` return only newer books.
and `ALLOW_DOWNGRADE` will return older books only if current book is
invalid.
Now the search results page is presented by the backend in the language
controlled by the value of the `userlang` URL query parameter (or, if
the latter is missing, the value of the `Accept-Language:` HTTP header).
Note that the front-end doesn't yet take advantage of this
functionality.