diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-24 21:48:12 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-24 21:48:12 +0300 |
commit | 564e394ec80fed5174a7c42edcd6801ba8c29058 (patch) | |
tree | bc928263d89a37833dd7f2e17a7cf29ffa10c5e7 /launcher/modplatform/modrinth | |
parent | bcf45c74a1b0b3389c05927637bf8aa95b8e43cf (diff) | |
download | PrismLauncher-564e394ec80fed5174a7c42edcd6801ba8c29058.tar.gz PrismLauncher-564e394ec80fed5174a7c42edcd6801ba8c29058.tar.bz2 PrismLauncher-564e394ec80fed5174a7c42edcd6801ba8c29058.zip |
feat:Update mods now fills missing dependencies
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/modrinth')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp index a7c22832..dac11022 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp @@ -145,26 +145,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.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()); |