diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-09-28 23:06:18 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-09-28 23:06:18 +0300 |
commit | 4802f6950e45d795303d3bc89d6f2e56293d2618 (patch) | |
tree | 3ba73bcdd89f278aaab6826e10c7c5659e5f71b6 /launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | |
parent | 5b7c5607a90cbb6ff78ba140a15d6180842d069b (diff) | |
parent | 531b58093eadba6bd856c4e30fb3b9a30dc270ee (diff) | |
download | PrismLauncher-4802f6950e45d795303d3bc89d6f2e56293d2618.tar.gz PrismLauncher-4802f6950e45d795303d3bc89d6f2e56293d2618.tar.bz2 PrismLauncher-4802f6950e45d795303d3bc89d6f2e56293d2618.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into feat/acknowledge_release_type
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp index 804eb0ba..9b7c5385 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp @@ -38,7 +38,7 @@ void ModrinthCheckUpdate::executeTask() QStringList hashes; auto best_hash_type = ProviderCaps.hashType(ModPlatform::ResourceProvider::MODRINTH).first(); - ConcurrentTask hashing_task(this, "MakeModrinthHashesTask", 10); + ConcurrentTask hashing_task(this, "MakeModrinthHashesTask", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()); for (auto* mod : m_mods) { if (!mod->enabled()) { emit checkFailed(mod, tr("Disabled mods won't be updated, to prevent mod duplication issues!")); @@ -144,26 +144,27 @@ void ModrinthCheckUpdate::executeTask() auto mod = *mod_iter; auto key = project_ver.hash; + + // Fake pack with the necessary info to pass to the download task :) + auto pack = std::make_shared<ModPlatform::IndexedPack>(); + pack->name = mod->name(); + pack->slug = mod->metadata()->slug; + pack->addonId = mod->metadata()->project_id; + pack->websiteUrl = mod->homeurl(); + for (auto& author : mod->authors()) + pack->authors.append({ author }); + pack->description = mod->description(); + pack->provider = ModPlatform::ResourceProvider::MODRINTH; if ((key != hash && project_ver.is_preferred) || (mod->status() == ModStatus::NotInstalled)) { if (mod->version() == project_ver.version_number) continue; - // Fake pack with the necessary info to pass to the download task :) - auto pack = std::make_shared<ModPlatform::IndexedPack>(); - pack->name = mod->name(); - pack->slug = mod->metadata()->slug; - pack->addonId = mod->metadata()->project_id; - pack->websiteUrl = mod->homeurl(); - for (auto& author : mod->authors()) - pack->authors.append({ author }); - pack->description = mod->description(); - pack->provider = ModPlatform::ResourceProvider::MODRINTH; - auto download_task = makeShared<ResourceDownloadTask>(pack, project_ver, m_mods_folder); m_updatable.emplace_back(pack->name, hash, mod->version(), project_ver.version_number, project_ver.version_type, project_ver.changelog, ModPlatform::ResourceProvider::MODRINTH, download_task); } + m_deps.append(std::make_shared<GetModDependenciesTask::PackDependency>(pack, project_ver)); } } catch (Json::JsonException& e) { failed(e.cause() + " : " + e.what()); |