This commit is contained in:
Daniel 2024-04-24 20:10:08 +08:00
parent ffb44137f2
commit d9351213da
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
11 changed files with 21 additions and 21 deletions

View file

@ -89,7 +89,7 @@ func Widgets() (widgets []*Widget) {
widget.Stars = repo.Stars
widget.OpenIssues = repo.OpenIssues
widget.Size = repo.Size
widget.HSize = humanize.Bytes(uint64(widget.Size))
widget.HSize = humanize.BytesCustomCeil(uint64(widget.Size), 2)
widget.HUpdated = formatUpdated(widget.Updated)
pkg := bazaarIndex[strings.Split(repoURL, "@")[0]]
if nil != pkg {
@ -157,7 +157,7 @@ func InstalledWidgets() (ret []*Widget) {
widget.HInstallDate = info.ModTime().Format("2006-01-02")
installSize, _ := util.SizeOfDirectory(installPath)
widget.InstallSize = installSize
widget.HInstallSize = humanize.Bytes(uint64(installSize))
widget.HInstallSize = humanize.BytesCustomCeil(uint64(installSize), 2)
readmeFilename := getPreferredReadme(widget.Readme)
readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename))
if nil != readErr {