validate metadata on launch

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-06-17 01:33:11 +03:00
parent 4aa2e5b85d
commit 2af6902b42
30 changed files with 253 additions and 215 deletions

View File

@ -32,8 +32,7 @@ void AssetUpdateTask::executeTask()
auto hexSha1 = assets->sha1.toLatin1();
qDebug() << "Asset index SHA1:" << hexSha1;
auto dl = Net::ApiDownload::makeCached(indexUrl, entry);
auto rawSha1 = QByteArray::fromHex(assets->sha1.toLatin1());
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, assets->sha1));
job->addNetAction(dl);
downloadJob.reset(job);