Automatically update property

What I’m trying to do

One of my uses for Obsidian is as a tracker for the media. I have notes for each of the comic series and its subsequent issues (all in a folder with the series title) and I am looking to display the percentage of issue I have read in a base. I currently have a property that lists the total amount of issues and want to add the amount of issues currently read to my series note.

Things I have tried

Ideally I wouldn’t want to update the issues read manually, and I’ve created a templater that does this.


<%*
const dv = app.plugins.plugins.dataview.api
const path = tp.file.folder(true)
const readCh = dv.pages(`"${path}" and #🍿/💭/issue`).where(p => p.readTimes != null).length

tp.hooks.on_all_templates_executed(async () => {
  const file = tp.file.find_tfile(tp.file.path(true));
  await tp.app.fileManager.processFrontMatter(file, (frontmatter) => {
    frontmatter["readChapters"] = readCh;
  });
});
-%>

I’m assuming I can’t access the number of issues through a formula in the base, so I was wondering if there’s any way to run this template in a more automated way. TIA :slight_smile: