add open source filter

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-10-27 11:56:48 +02:00
parent 5b8ea89092
commit 935b2e8fb2
8 changed files with 31 additions and 5 deletions

View File

@@ -39,7 +39,9 @@ ResourceAPI::SearchArgs ModModel::createSearchArguments()
auto sort = getCurrentSortingMethodByIndex();
return { ModPlatform::ResourceType::MOD, m_next_search_offset, m_search_term, sort, loaders, versions, side, categories };
return {
ModPlatform::ResourceType::MOD, m_next_search_offset, m_search_term, sort, loaders, versions, side, categories, m_filter->openSource
};
}
ResourceAPI::VersionSearchArgs ModModel::createVersionsArguments(QModelIndex& entry)

View File

@@ -189,7 +189,7 @@ void ListModel::performPaginatedSearch()
auto netJob = makeShared<NetJob>("Flame::Search", APPLICATION->network());
auto searchUrl = FlameAPI().getSearchURL({ ModPlatform::ResourceType::MODPACK, nextSearchOffset, currentSearchTerm, sort,
m_filter->loaders, m_filter->versions, "", m_filter->categoryIds });
m_filter->loaders, m_filter->versions, "", m_filter->categoryIds, m_filter->openSource });
netJob->addNetAction(Net::ApiDownload::makeByteArray(QUrl(searchUrl.value()), response));
jobPtr = netJob;

View File

@@ -155,7 +155,7 @@ void ModpackListModel::performPaginatedSearch()
ResourceAPI::SortingMethod sort{};
sort.name = currentSort;
auto searchUrl = ModrinthAPI().getSearchURL({ ModPlatform::ResourceType::MODPACK, nextSearchOffset, currentSearchTerm, sort,
m_filter->loaders, m_filter->versions, "", m_filter->categoryIds });
m_filter->loaders, m_filter->versions, "", m_filter->categoryIds, m_filter->openSource });
auto netJob = makeShared<NetJob>("Modrinth::SearchModpack", APPLICATION->network());
netJob->addNetAction(Net::ApiDownload::makeByteArray(QUrl(searchUrl.value()), m_allResponse));