diff options
author | timoreo <timo.oreo34@gmail.com> | 2022-01-14 12:47:18 +0100 |
---|---|---|
committer | timoreo <timo.oreo34@gmail.com> | 2022-01-14 12:47:18 +0100 |
commit | 9e6fa8f29aa8bc0f609bfcdb6460c6845b73448a (patch) | |
tree | c16b5e4599d8d3db16150b03d68755a5769e4789 /launcher/modplatform | |
parent | 4d599eb118fb066c6204b29c34d6e1acbc0e8e06 (diff) | |
download | PrismLauncher-9e6fa8f29aa8bc0f609bfcdb6460c6845b73448a.tar.gz PrismLauncher-9e6fa8f29aa8bc0f609bfcdb6460c6845b73448a.tar.bz2 PrismLauncher-9e6fa8f29aa8bc0f609bfcdb6460c6845b73448a.zip |
Added the downloading of the mods
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 4 | ||||
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index fa421ab2..fbfaeac8 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -37,7 +37,9 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray file.mcVersion = versionArray[0].toString(); file.version = Json::requireString(obj, "name"); //TODO show all the files ? - file.downloadUrl = Json::requireString(Json::requireArray(obj, "files")[0].toObject(),"url"); + auto parent = Json::requireArray(obj, "files")[0].toObject(); + file.downloadUrl = Json::requireString(parent, "url"); + file.fileName = Json::requireString(parent, "filename"); unsortedVersions.append(file); } auto orderSortPredicate = [](const IndexedVersion & a, const IndexedVersion & b) -> bool diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.h b/launcher/modplatform/modrinth/ModrinthPackIndex.h index afc31ff2..e39b69ab 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.h +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.h @@ -22,6 +22,7 @@ struct IndexedVersion { QString mcVersion; QString downloadUrl; QString date; + QString fileName; }; struct IndexedPack |