Skip to content

Commit

Permalink
small file hash typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaibu committed May 1, 2024
1 parent d54b727 commit afb600f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "panthor",
"version": "2.0.5",
"version": "2.0.6",
"main": "dist-electron/main/index.js",
"description": "Panthor Launcher",
"author": "Kaibu",
Expand Down
7 changes: 4 additions & 3 deletions src/services/Update.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ export class UpdateService {
} catch (error) {
console.error('Failed to unlink due to wrong hash: ', error);
}
if (!this.retriedFiles.includes(file)) {
const retriedTimes = this.retriedFiles.filter((retriedFile) => retriedFile.FileName === file.FileName).length
if (retriedTimes < 5) {
console.log('Retrying download for', file.FileName)
this.retriedFiles.push(file)
await this.downloadFile(file)
Expand Down Expand Up @@ -522,7 +523,7 @@ export class UpdateService {
}
*/

if (!quick || file.FileName.includes('.bisign') && file.FileName.includes('.dll') && file.FileName.includes('.paa') && file.FileName.includes('.cpp') && fileSize < 5000000) {
if (!quick || file.FileName.includes('.bisign') || file.FileName.includes('.dll') || file.FileName.includes('.paa') || file.FileName.includes('.cpp') || fileSize < 1000000) {
const hash = crypto.createHash('md5');
const fileData = await readFile(fullFilePath);

Expand All @@ -536,7 +537,7 @@ export class UpdateService {
if (hashDigest !== file.Hash.toUpperCase()) {
this.wrongHashes.push(file);
} else {
//if (!file.FileName.includes('.bisign') && !file.FileName.includes('.dll') && !file.FileName.includes('.paa') && !file.FileName.includes('.cpp'))

//this.writeHashFile(file, hashDigest)
}
resolve(true)
Expand Down

0 comments on commit afb600f

Please sign in to comment.