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

@@ -591,8 +591,7 @@ void TranslationsModel::downloadTranslation(QString key)
entry->setStale(true);
auto dl = Net::Download::makeCached(QUrl(BuildConfig.TRANSLATIONS_BASE_URL + lang->file_name), entry);
auto rawHash = QByteArray::fromHex(lang->file_sha1.toLatin1());
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawHash));
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, lang->file_sha1));
dl->setProgress(dl->getProgress(), lang->file_size);
d->m_dl_job.reset(new NetJob("Translation for " + key, APPLICATION->network()));