From 76b2036eed82290fa4e44376e72262489b8c9c38 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 22 Mar 2024 10:33:24 +0800 Subject: [PATCH] :art: Support opening assets through other apps on the Android https://github.com/siyuan-note/siyuan/issues/10657 --- kernel/mobile/kernel.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/mobile/kernel.go b/kernel/mobile/kernel.go index adc6a0bf1..7aff63245 100644 --- a/kernel/mobile/kernel.go +++ b/kernel/mobile/kernel.go @@ -24,6 +24,7 @@ import ( "time" "github.com/siyuan-note/filelock" + "github.com/siyuan-note/logging" "github.com/siyuan-note/siyuan/kernel/cache" "github.com/siyuan-note/siyuan/kernel/job" "github.com/siyuan-note/siyuan/kernel/model" @@ -89,6 +90,15 @@ func GetCurrentWorkspacePath() string { return util.WorkspaceDir } +func GetAssetAbsPath(asset string) (ret string) { + ret, err := model.GetAssetAbsPath(asset) + if nil != err { + logging.LogErrorf("get asset [%s] abs path failed: %s", asset, err) + ret = asset + } + return +} + func SetTimezone(container, appDir, timezoneID string) { if "ios" == container { os.Setenv("ZONEINFO", filepath.Join(appDir, "app", "zoneinfo.zip"))