chhoumann / MetaEdit

MetaEdit for Obsidian
https://bagerbach.com
GNU General Public License v3.0
393 stars 15 forks source link

Update API Support for Obsidian Version 1.4.5 #101

Open shubymao opened 10 months ago

shubymao commented 10 months ago

The update API for updating the metadata no longer work as intended after updating to obsidian version 1.4.5 (latest version as of Sept 4, 2023).

For example, I have the following templater code to simply toggle a front matter called outdoor between 1 and 0. When I perform the action, the result behavior causes shift in value of other frontmatter field along with it.

const newOutdoorState = tp.frontmatter["outdoor"] == 0 ? 1 : 0;
await update("outdoor", newOutdoorState, tp.file.path(true))

before

---
outdoor: 0
reading: 0
---

What happen after running the template

---
outdoor: 1
reading: 1
---

What I expect should happen after running the template

---
outdoor: 1
reading: 0
---

Let me know if you need more context about the issue. Thank you again for providing this plugin. It was very useful to me. Hopefully we can get this resolved.