Update Manager to use Archive instead of Reader

kiwix::Manager uses Reader to import a zim file, it should be using
zim::Archive directly.
This commit is contained in:
Maneesh P M 2021-07-03 15:19:00 +05:30 committed by Matthieu Gautier
parent 8b12434ff2
commit a3ba7619df
1 changed files with 2 additions and 2 deletions

View File

@ -215,8 +215,8 @@ bool Manager::readBookFromPath(const std::string& path, kiwix::Book* book)
tmp_path = computeAbsolutePath(getCurrentDirectory(), path);
}
try {
kiwix::Reader reader(tmp_path);
book->update(reader);
zim::Archive archive(tmp_path);
book->update(archive);
book->setPathValid(true);
} catch (const std::exception& e) {
book->setPathValid(false);