mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 04:32:15 -04:00
add "notag" parameter to the search api
The notag parameter is filled with all categories from the category list separated by a ";"
This commit is contained in:
parent
e8d98f04e2
commit
8a37a83e8f
@ -1,4 +1,5 @@
|
|||||||
#include "opdsrequestmanager.h"
|
#include "opdsrequestmanager.h"
|
||||||
|
#include "kiwixapp.h"
|
||||||
|
|
||||||
OpdsRequestManager::OpdsRequestManager()
|
OpdsRequestManager::OpdsRequestManager()
|
||||||
: mp_reply(nullptr)
|
: mp_reply(nullptr)
|
||||||
@ -14,9 +15,22 @@ void OpdsRequestManager::doUpdate(const QString& currentLanguage, const QString&
|
|||||||
query.addQueryItem("lang", currentLanguage);
|
query.addQueryItem("lang", currentLanguage);
|
||||||
}
|
}
|
||||||
query.addQueryItem("count", QString::number(0));
|
query.addQueryItem("count", QString::number(0));
|
||||||
if (categoryFilter != "all") {
|
if (categoryFilter != "all" && categoryFilter != "other") {
|
||||||
query.addQueryItem("tag", categoryFilter);
|
query.addQueryItem("tag", categoryFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (categoryFilter == "other") {
|
||||||
|
auto allCategories = KiwixApp::instance()->getMainWindow()->getSideContentManager()->getCategoryList();
|
||||||
|
QStringList excludeTags;
|
||||||
|
for (auto& category:allCategories) {
|
||||||
|
if (category != "Other") {
|
||||||
|
excludeTags += category.toLower();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
query.addQueryItem("notag", excludeTags.join(";"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QUrl url;
|
QUrl url;
|
||||||
url.setScheme("http");
|
url.setScheme("http");
|
||||||
url.setHost(CATALOG_HOST);
|
url.setHost(CATALOG_HOST);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user