Add automatic goal count for outline folders

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
TheJackiMonster 2022-10-30 17:53:38 +01:00
parent 3481e40b4f
commit 995a78058c
No known key found for this signature in database
GPG key ID: D850A5F772E880F9

View file

@ -175,6 +175,15 @@ class OutlineFolder(OutlineItem):
return count
def goalCount(self) -> int:
count = super().goalCount()
if self.goal is None:
for item in self.items:
count += item.goalCount()
return count
def load(self, _: bool = True):
metadata, _ = self.file.loadMMD(True)
OutlineItem.loadMetadata(self, metadata)