feat: Add inital page to add random Haiku to starpage

Refs: OPS-62
This commit is contained in:
Alivecow 2025-03-26 19:36:39 +01:00
parent f4b1922ed7
commit d9044ff53e
3 changed files with 40 additions and 2 deletions

View file

@ -175,6 +175,15 @@ class StoreManager:
"""
return self._save(data.__dict__)
def count_entries(self) -> int:
"""
Query the store how many Haikus are stored.
:return: Number of stored haikus.
:rtype: int
"""
return len(self._db.all())
def get_id_of_latest_haiku(self) -> Optional[int]:
"""
Get the ID of the most recently added haiku.