Skip to content

Commit

Permalink
Cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
9KwHCUDP authored and 9KwHCUDP committed Aug 28, 2019
1 parent 912eb33 commit 114f561
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,8 @@ class CSGOCdn extends EventEmitter {

this.log.info(`${status} Downloading ${fileName} - ${bytesToMB(file.size)} MB`);

await this.user.downloadFile(730, 731, file, filePath, (none, data) => {
const { type, bytesDownloaded, totalSizeBytes } = data;

if (type == 'progress') {
await this.user.downloadFile(730, 731, file, filePath, (none, { type, bytesDownloaded, totalSizeBytes }) => {
if (type === 'progress') {
this.log.info(`${status} ${(bytesDownloaded*100/totalSizeBytes).toFixed(2)}% - ${bytesToMB(bytesDownloaded)}/${bytesToMB(totalSizeBytes)} MB`);
}
});
Expand Down

0 comments on commit 114f561

Please sign in to comment.