diff --git a/include/manager.h b/include/manager.h index 13fe19f10..6171f2ebd 100644 --- a/include/manager.h +++ b/include/manager.h @@ -81,6 +81,8 @@ class Manager * Sync the contents of the library with one or more `library.xml` files. * * The metadata of the library files is trusted unconditionally. + * Any books not present in the input library.xml files are removed + * from the library. * * @param paths The (utf8) paths to the `library.xml` files. */ diff --git a/src/manager.cpp b/src/manager.cpp index b65353542..e01b38ce9 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -291,6 +291,7 @@ bool Manager::readBookmarkFile(const std::string& path) void Manager::reload(const Paths& paths) { + const auto libRevision = manipulator->getLibrary().getRevision(); for (std::string path : paths) { if (!path.empty()) { if ( kiwix::isRelativePath(path) ) @@ -301,6 +302,10 @@ void Manager::reload(const Paths& paths) } } } + + // XXX: must remove the books via manipulator, otherwise the event + // XXX: may go unnoticed + manipulator->getLibrary().removeBooksNotUpdatedSince(libRevision); } }