feat:replace filename with local path in content for media refs
This commit is contained in:
parent
30584f04cb
commit
109c28a76d
1 changed files with 6 additions and 0 deletions
|
|
@ -53,6 +53,12 @@ func resolveMediaRefs(messages []providers.Message, store media.MediaStore, maxS
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if meta.Filename != "" && result[i].Content != "" {
|
||||||
|
oldPattern := meta.Filename + " [file]"
|
||||||
|
newPattern :=oldPattern + " PATH=" + localPath
|
||||||
|
result[i].Content = strings.ReplaceAll(result[i].Content, oldPattern, newPattern)
|
||||||
|
}
|
||||||
|
|
||||||
info, err := os.Stat(localPath)
|
info, err := os.Stat(localPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.WarnCF("agent", "Failed to stat media file", map[string]any{
|
logger.WarnCF("agent", "Failed to stat media file", map[string]any{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue