Skip to content

Commit

Permalink
fix: wrong file size calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
amalcaraz committed Jul 10, 2023
1 parent 77fb8a8 commit d7f4ebd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/domain/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ export class FileManager {

protected parseSizesMap(files: AccountFileObject[]): void {
this.lastFetch = Date.now()
console.log(files)
this.sizesMapCache = files.reduce((ac, cv) => {
ac[cv.item_hash] = cv.size
// @note: Cast from bytes to MBs
ac[cv.item_hash] = cv.size / 10 ** 6
return ac
}, {} as Record<string, number>)
}
Expand Down

0 comments on commit d7f4ebd

Please sign in to comment.