NOISSUE 'required' attribute of curse manifests is optional, libraries attribute reading
This commit is contained in:
parent
1d71214d4a
commit
6a525db78d
@ -5,7 +5,8 @@ static void loadFileV1(Curse::File & f, QJsonObject & file)
|
|||||||
{
|
{
|
||||||
f.projectId = Json::requireInteger(file, "projectID");
|
f.projectId = Json::requireInteger(file, "projectID");
|
||||||
f.fileId = Json::requireInteger(file, "fileID");
|
f.fileId = Json::requireInteger(file, "fileID");
|
||||||
f.required = Json::requireBoolean(file, "required");
|
// FIXME: what does this mean?
|
||||||
|
f.required = Json::ensureBoolean(file, QString("required"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadModloaderV1(Curse::Modloader & m, QJsonObject & modLoader)
|
static void loadModloaderV1(Curse::Modloader & m, QJsonObject & modLoader)
|
||||||
@ -17,6 +18,8 @@ static void loadModloaderV1(Curse::Modloader & m, QJsonObject & modLoader)
|
|||||||
static void loadMinecraftV1(Curse::Minecraft & m, QJsonObject & minecraft)
|
static void loadMinecraftV1(Curse::Minecraft & m, QJsonObject & minecraft)
|
||||||
{
|
{
|
||||||
m.version = Json::requireString(minecraft, "version");
|
m.version = Json::requireString(minecraft, "version");
|
||||||
|
// FIXME: default unknown, assuming empty. Meaning also unknown.
|
||||||
|
m.libraries = Json::ensureString(minecraft, QString("libraries"), QString());
|
||||||
auto arr = Json::ensureArray(minecraft, "modLoaders", QJsonArray());
|
auto arr = Json::ensureArray(minecraft, "modLoaders", QJsonArray());
|
||||||
for (const auto & item : arr)
|
for (const auto & item : arr)
|
||||||
{
|
{
|
||||||
|
@ -26,6 +26,7 @@ struct Modloader
|
|||||||
struct Minecraft
|
struct Minecraft
|
||||||
{
|
{
|
||||||
QString version;
|
QString version;
|
||||||
|
QString libraries;
|
||||||
QVector<Curse::Modloader> modLoaders;
|
QVector<Curse::Modloader> modLoaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user