diff options
| author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-09-28 22:03:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-28 22:03:14 +0200 |
| commit | 531b58093eadba6bd856c4e30fb3b9a30dc270ee (patch) | |
| tree | 0600d5a8b50f382012c6bce7c047719e629ad8b6 /launcher/modplatform/modrinth | |
| parent | 2ff9ef062034ec84ac75d6e4d294f2a448e7dfdd (diff) | |
| parent | 81a3ba18bc9740d543fe9aa569f74f37ec46c2cc (diff) | |
| download | PrismLauncher-531b58093eadba6bd856c4e30fb3b9a30dc270ee.tar.gz PrismLauncher-531b58093eadba6bd856c4e30fb3b9a30dc270ee.tar.bz2 PrismLauncher-531b58093eadba6bd856c4e30fb3b9a30dc270ee.zip | |
Merge pull request #1263 from Trial97/develop
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 07c47f14..ab07a363 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp @@ -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.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()); |
