Merge pull request #791 from kiwix/fix_other_filtering

Correctly set the "acceptTags" when we filter by tags.
This commit is contained in:
Kelson 2022-02-14 20:09:56 +01:00 committed by GitHub
commit 969746913f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,6 +396,7 @@ QStringList ContentManager::getBookIds()
std::vector<std::string> tags;
if (m_categoryFilter != "all" && m_categoryFilter != "other") {
tags.push_back("_category:"+m_categoryFilter.toStdString());
filter.acceptTags(tags);
}
if (m_categoryFilter == "other") {
for (auto& category: S_CATEGORIES) {
@ -416,7 +417,6 @@ QStringList ContentManager::getBookIds()
}
}
filter.acceptTags(tags);
filter.query(m_searchQuery.toStdString());
if (m_currentLanguage != "*")
filter.lang(m_currentLanguage.toStdString());