ModrinthCheckUpdate: don't send a request that is doomed to fail

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2026-01-22 22:34:44 +05:00
parent b276ede6e5
commit 29afecdbde
No known key found for this signature in database
GPG key ID: B77C34313AEE1FFF

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.get());
connect(job.get(), &Task::succeeded, this, [this, response, loader] { checkVersionsResponse(response.get(), loader); });