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

@ -283,8 +283,7 @@ Net::NetRequest::Ptr AssetObject::getDownloadAction()
if ((!objectFile.isFile()) || (objectFile.size() != size)) {
auto objectDL = Net::ApiDownload::makeFile(getUrl(), objectFile.filePath());
if (hash.size()) {
auto rawHash = QByteArray::fromHex(hash.toLatin1());
objectDL->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawHash));
objectDL->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, hash));
}
objectDL->setProgress(objectDL->getProgress(), size);
return objectDL;