mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 数据统计
This commit is contained in:
parent
70490f3e16
commit
953ce38ab7
7 changed files with 51 additions and 12 deletions
|
|
@ -209,6 +209,19 @@ func SizeOfDirectory(path string) (size int64, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func CeilSize(size int64) int64 {
|
||||
if 100*1024*1024 > size {
|
||||
return 100 * 1024 * 1024
|
||||
}
|
||||
|
||||
for i := int64(1); i < 40; i++ {
|
||||
if 1024*1024*200*i > size {
|
||||
return 1024 * 1024 * int64(i)
|
||||
}
|
||||
}
|
||||
return 1024*1024*200*40 + 1
|
||||
}
|
||||
|
||||
func IsReservedFilename(baseName string) bool {
|
||||
return "assets" == baseName || "templates" == baseName || "widgets" == baseName || "emojis" == baseName || ".siyuan" == baseName || strings.HasPrefix(baseName, ".")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue