mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 08:00:13 +01:00
✨ Support for searching asset content https://github.com/siyuan-note/siyuan/issues/8874
This commit is contained in:
parent
ae259933ca
commit
9f6d08ac01
1 changed files with 3 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ import (
|
||||||
"code.sajari.com/docconv"
|
"code.sajari.com/docconv"
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
"github.com/88250/lute/ast"
|
"github.com/88250/lute/ast"
|
||||||
|
"github.com/dustin/go-humanize"
|
||||||
"github.com/siyuan-note/eventbus"
|
"github.com/siyuan-note/eventbus"
|
||||||
"github.com/siyuan-note/filelock"
|
"github.com/siyuan-note/filelock"
|
||||||
"github.com/siyuan-note/logging"
|
"github.com/siyuan-note/logging"
|
||||||
|
|
@ -43,6 +44,7 @@ type AssetContent struct {
|
||||||
Ext string `json:"ext"`
|
Ext string `json:"ext"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
|
HSize string `json:"hSize"`
|
||||||
Updated int64 `json:"updated"`
|
Updated int64 `json:"updated"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
}
|
}
|
||||||
|
|
@ -219,6 +221,7 @@ func fromSQLAssetContent(assetContent *sql.AssetContent, beforeLen int) *AssetCo
|
||||||
Ext: assetContent.Ext,
|
Ext: assetContent.Ext,
|
||||||
Path: assetContent.Path,
|
Path: assetContent.Path,
|
||||||
Size: assetContent.Size,
|
Size: assetContent.Size,
|
||||||
|
HSize: humanize.Bytes(uint64(assetContent.Size)),
|
||||||
Updated: assetContent.Updated,
|
Updated: assetContent.Updated,
|
||||||
Content: assetContent.Content,
|
Content: assetContent.Content,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue