GH-2026 fix native library downloads
If a single library had both native and java jars, they would randomly get confused.
This commit is contained in:
parent
ab870648bd
commit
3eebc641f9
@ -104,6 +104,7 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
|
||||
}
|
||||
if (isForge)
|
||||
{
|
||||
qDebug() << "XzDownload for:" << rawName() << "storage:" << storage << "url:" << url;
|
||||
out.append(ForgeXzDownload::make(storage, entry));
|
||||
}
|
||||
else
|
||||
@ -113,11 +114,14 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
|
||||
auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
|
||||
auto dl = Net::Download::makeCached(url, entry, options);
|
||||
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
|
||||
qDebug() << "Checksummed Download for:" << rawName() << "storage:" << storage << "url:" << url;
|
||||
out.append(dl);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
out.append(Net::Download::makeCached(url, entry, options));
|
||||
qDebug() << "Download for:" << rawName() << "storage:" << storage << "url:" << url;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@ -125,11 +129,8 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
|
||||
QString raw_storage = storageSuffix(system);
|
||||
if(m_mojangDownloads)
|
||||
{
|
||||
if(m_mojangDownloads->artifact)
|
||||
if(isNative())
|
||||
{
|
||||
auto artifact = m_mojangDownloads->artifact;
|
||||
add_download(raw_storage, artifact->url, artifact->sha1);
|
||||
}
|
||||
if(m_nativeClassifiers.contains(system))
|
||||
{
|
||||
auto nativeClassifier = m_nativeClassifiers[system];
|
||||
@ -163,6 +164,23 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Ignoring native library" << m_name << "because it has no classifier for current OS";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_mojangDownloads->artifact)
|
||||
{
|
||||
auto artifact = m_mojangDownloads->artifact;
|
||||
add_download(raw_storage, artifact->url, artifact->sha1);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Ignoring java library" << m_name << "because it has no artifact";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user