Skip to content

Commit

Permalink
Show IEC storage sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
rigon committed Apr 19, 2023
1 parent da728d9 commit db3664a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "photo-gallery",
"private": true,
"version": "1.2.0",
"version": "1.2.3",
"type": "module",
"scripts": {
"start": "vite",
Expand Down
6 changes: 3 additions & 3 deletions server/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ func (collection *Collection) StorageUsage() (*CollectionStorage, error) {
}
percentage := (float64(di.Total-di.Free) / float64(di.Total)) * 100
return &CollectionStorage{
Size: humanize.Bytes(di.Total),
Free: humanize.Bytes(di.Free),
Used: humanize.Bytes(di.Total - di.Free),
Size: humanize.IBytes(di.Total),
Free: humanize.IBytes(di.Free),
Used: humanize.IBytes(di.Total - di.Free),
Percentage: int(math.Round(percentage)),
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion server/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (file *File) ExtractExtendedInfo() (info FileExtendedInfo, err error) {
}
info.FileStat.Name = fileInfo.Name()
info.FileStat.Size = fileInfo.Size()
info.FileStat.SizeHuman = humanize.Bytes(uint64(fileInfo.Size()))
info.FileStat.SizeHuman = humanize.IBytes(uint64(fileInfo.Size()))
info.FileStat.ModTime = fileInfo.ModTime()
info.FileStat.Perm = fileInfo.Mode().Perm().String()

Expand Down

0 comments on commit db3664a

Please sign in to comment.