mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Activate search by project id only for numarical values for CurseForge
Signed-off-by: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com>
This commit is contained in:
parent
bf75d50baf
commit
4706f894e3
2 changed files with 5 additions and 1 deletions
|
|
@ -165,7 +165,10 @@ void ListModel::fetchMore(const QModelIndex& parent)
|
|||
void ListModel::performPaginatedSearch()
|
||||
{
|
||||
static const FlameAPI api;
|
||||
if (m_currentSearchTerm.startsWith("#")) {
|
||||
|
||||
// activate search by id only for numerical values because all CurseForge ids are numerical
|
||||
static const QRegularExpression s_projectIdExpr("^\\#[0-9]+$");
|
||||
if (s_projectIdExpr.match(m_currentSearchTerm).hasMatch()) {
|
||||
auto projectId = m_currentSearchTerm.mid(1);
|
||||
if (!projectId.isEmpty()) {
|
||||
ResourceAPI::Callback<ModPlatform::IndexedPack::Ptr> callbacks;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ void ModpackListModel::performPaginatedSearch()
|
|||
return;
|
||||
static const ModrinthAPI api;
|
||||
|
||||
// Modrinth ids are not limited to numbers and can be any length
|
||||
if (m_currentSearchTerm.startsWith("#")) {
|
||||
auto projectId = m_currentSearchTerm.mid(1);
|
||||
if (!projectId.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue