[Backport release-10.x] ModrinthCheckUpdate: Don't send a request that is doomed to fail (#4844)

This commit is contained in:
Alexandru Ionut Tripon 2026-01-22 22:45:36 +02:00 committed by GitHub
commit 43eeb14a7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,13 +90,19 @@ void ModrinthCheckUpdate::getUpdateModsForLoader(std::optional<ModPlatform::ModL
QStringList hashes;
if (forceModLoaderCheck && loader.has_value()) {
for (auto hash : m_mappings.keys()) {
if (m_mappings[hash]->metadata()->loaders & loader.value()) {
if (m_mappings.value(hash)->metadata()->loaders & loader.value()) {
hashes.append(hash);
}
}
} else {
hashes = m_mappings.keys();
}
if (hashes.isEmpty()) {
checkNextLoader();
return;
}
auto job = api.latestVersions(hashes, m_hashType, m_gameVersions, loader, response);
connect(job.get(), &Task::succeeded, this, [this, response, loader] { checkVersionsResponse(response, loader); });