mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve disk usage display https://github.com/siyuan-note/siyuan/issues/11121
This commit is contained in:
parent
ffb44137f2
commit
d9351213da
11 changed files with 21 additions and 21 deletions
|
|
@ -508,7 +508,7 @@ func (parser *TxtAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
|||
}
|
||||
|
||||
if TxtAssetContentMaxSize < info.Size() {
|
||||
logging.LogWarnf("text asset [%s] is too large [%s]", absPath, humanize.Bytes(uint64(info.Size())))
|
||||
logging.LogWarnf("text asset [%s] is too large [%s]", absPath, humanize.BytesCustomCeil(uint64(info.Size()), 2))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -836,16 +836,16 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
|||
if maxSize, parseErr := strconv.ParseUint(maxSizeVal, 10, 64); nil == parseErr {
|
||||
if maxSize != PDFAssetContentMaxSize {
|
||||
PDFAssetContentMaxSize = maxSize
|
||||
logging.LogInfof("set PDF asset content index max size to [%s]", humanize.Bytes(maxSize))
|
||||
logging.LogInfof("set PDF asset content index max size to [%s]", humanize.BytesCustomCeil(maxSize, 2))
|
||||
}
|
||||
} else {
|
||||
logging.LogWarnf("invalid env [SIYUAN_PDF_ASSET_CONTENT_INDEX_MAX_SIZE]: [%s], parsing failed: ", maxSizeVal, parseErr)
|
||||
logging.LogWarnf("invalid env [SIYUAN_PDF_ASSET_CONTENT_INDEX_MAX_SIZE]: [%s], parsing failed: %s", maxSizeVal, parseErr)
|
||||
}
|
||||
}
|
||||
|
||||
if PDFAssetContentMaxSize < uint64(len(pdfData)) {
|
||||
// PDF files larger than 128MB are not included in asset file content searching https://github.com/siyuan-note/siyuan/issues/9500
|
||||
logging.LogWarnf("ignore large PDF asset [%s] with [%s]", absPath, humanize.Bytes(uint64(len(pdfData))))
|
||||
logging.LogWarnf("ignore large PDF asset [%s] with [%s]", absPath, humanize.BytesCustomCeil(uint64(len(pdfData)), 2))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue