Fix for #257
This commit is contained in:
parent
0902fd5bec
commit
cf616efb5d
@ -164,6 +164,7 @@ void Mod::ReadMCModInfo(QByteArray contents)
|
|||||||
m_name = firstObj.value("name").toString();
|
m_name = firstObj.value("name").toString();
|
||||||
m_version = firstObj.value("version").toString();
|
m_version = firstObj.value("version").toString();
|
||||||
m_homeurl = firstObj.value("url").toString();
|
m_homeurl = firstObj.value("url").toString();
|
||||||
|
m_updateurl = firstObj.value("updateUrl").toString();
|
||||||
m_homeurl = m_homeurl.trimmed();
|
m_homeurl = m_homeurl.trimmed();
|
||||||
if(!m_homeurl.isEmpty())
|
if(!m_homeurl.isEmpty())
|
||||||
{
|
{
|
||||||
@ -203,6 +204,8 @@ void Mod::ReadMCModInfo(QByteArray contents)
|
|||||||
else if (jsonDoc.isObject())
|
else if (jsonDoc.isObject())
|
||||||
{
|
{
|
||||||
auto val = jsonDoc.object().value("modinfoversion");
|
auto val = jsonDoc.object().value("modinfoversion");
|
||||||
|
if(val.isUndefined())
|
||||||
|
val = jsonDoc.object().value("modListVersion");
|
||||||
int version = val.toDouble();
|
int version = val.toDouble();
|
||||||
if (version != 2)
|
if (version != 2)
|
||||||
{
|
{
|
||||||
@ -211,6 +214,8 @@ void Mod::ReadMCModInfo(QByteArray contents)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto arrVal = jsonDoc.object().value("modlist");
|
auto arrVal = jsonDoc.object().value("modlist");
|
||||||
|
if(arrVal.isUndefined())
|
||||||
|
arrVal = jsonDoc.object().value("modList");
|
||||||
if (arrVal.isArray())
|
if (arrVal.isArray())
|
||||||
{
|
{
|
||||||
getInfoFromArray(arrVal.toArray());
|
getInfoFromArray(arrVal.toArray());
|
||||||
|
@ -121,6 +121,7 @@ protected:
|
|||||||
QString m_version;
|
QString m_version;
|
||||||
QString m_mcversion;
|
QString m_mcversion;
|
||||||
QString m_homeurl;
|
QString m_homeurl;
|
||||||
|
QString m_updateurl;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
QString m_authors;
|
QString m_authors;
|
||||||
QString m_credits;
|
QString m_credits;
|
||||||
|
Loading…
Reference in New Issue
Block a user