mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
🎨 改进集市已下载包更新 https://github.com/siyuan-note/siyuan/issues/5807
This commit is contained in:
parent
fcfbab3652
commit
9bc71a9f2c
15 changed files with 49 additions and 38 deletions
|
|
@ -124,6 +124,8 @@ func InstalledIcons() (ret []*Icon) {
|
|||
continue
|
||||
}
|
||||
|
||||
installPath := filepath.Join(util.IconsPath, dirName)
|
||||
|
||||
icon := &Icon{}
|
||||
icon.Installed = true
|
||||
icon.Name = iconConf["name"].(string)
|
||||
|
|
@ -134,10 +136,11 @@ func InstalledIcons() (ret []*Icon) {
|
|||
icon.PreviewURL = "/appearance/icons/" + dirName + "/preview.png"
|
||||
icon.PreviewURLThumb = "/appearance/icons/" + dirName + "/preview.png"
|
||||
icon.Updated = iconDir.ModTime().Format("2006-01-02 15:04:05")
|
||||
icon.Size = iconDir.Size()
|
||||
icon.HSize = humanize.Bytes(uint64(icon.Size))
|
||||
icon.HUpdated = formatUpdated(icon.Updated)
|
||||
readme, readErr := os.ReadFile(filepath.Join(util.IconsPath, dirName, "README.md"))
|
||||
installSize, _ := util.SizeOfDirectory(installPath)
|
||||
icon.InstallSize = installSize
|
||||
icon.HInstallSize = humanize.Bytes(uint64(installSize))
|
||||
readme, readErr := os.ReadFile(filepath.Join(installPath, "README.md"))
|
||||
if nil != readErr {
|
||||
logging.LogWarnf("read install icon README.md failed: %s", readErr)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue