mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +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
|
|
@ -190,23 +190,14 @@ func IsSubFolder(parent, sub string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
const CloudSingleFileMaxSizeLimit = 96 * 1000 * 1000
|
||||
|
||||
func SizeOfDirectory(path string, includeBigFile bool) (int64, error) {
|
||||
var size int64
|
||||
err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {
|
||||
func SizeOfDirectory(path string) (size int64, err error) {
|
||||
err = filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {
|
||||
if nil != err {
|
||||
return err
|
||||
}
|
||||
if !info.IsDir() {
|
||||
s := info.Size()
|
||||
if CloudSingleFileMaxSizeLimit < s {
|
||||
if includeBigFile {
|
||||
size += s
|
||||
}
|
||||
} else {
|
||||
size += s
|
||||
}
|
||||
size += s
|
||||
} else {
|
||||
size += 4096
|
||||
}
|
||||
|
|
@ -215,7 +206,7 @@ func SizeOfDirectory(path string, includeBigFile bool) (int64, error) {
|
|||
if nil != err {
|
||||
logging.LogErrorf("size of dir [%s] failed: %s", path, err)
|
||||
}
|
||||
return size, err
|
||||
return
|
||||
}
|
||||
|
||||
func IsReservedFilename(baseName string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue