NameMapper detects all naming conflicts

Also this change leads to the change in the mapping (since conflicts
that previously went undetected and just overwrote the existing entry
are now rejected).
This commit is contained in:
Veloman Yunkan
2024-03-05 19:20:24 +04:00
committed by Matthieu Gautier
parent 181893d31a
commit 0168764f4c
2 changed files with 27 additions and 8 deletions

View File

@ -29,7 +29,7 @@ HumanReadableNameMapper::HumanReadableNameMapper(kiwix::Library& library, bool w
auto& currentBook = library.getBookById(bookId);
auto bookName = currentBook.getHumanReadableIdFromPath();
m_idToName[bookId] = bookName;
m_nameToId[bookName] = bookId;
mapName(library, bookName, bookId);
if (!withAlias)
continue;