Find a meeting by the date it was recorded, not only by its stem

A stem is all digits too, so "dikte meetings show 20260801" was read as a
position and found nothing: there is no twenty-millionth meeting. A number
counts back only while there are that many meetings to count back through,
and anything larger is a date somebody typed.
This commit is contained in:
yusufipk
2026-08-01 20:06:35 +07:00
parent 45779a6c50
commit 1b12ae0c2f
+5 -3
View File
@@ -361,9 +361,11 @@ def _find_meeting(which):
return None return None
if which in ("", "last"): if which in ("", "last"):
return rows[-1] return rows[-1]
if which.isdigit(): # A stem is all digits too, so a number is only a position while there are
index = int(which) # that many meetings to count back through. Anything larger is a date
return rows[-index] if 0 < index <= len(rows) else None # somebody typed: nobody is looking for the twenty-millionth meeting.
if which.isdigit() and 0 < int(which) <= len(rows):
return rows[-int(which)]
exact = [row for row in rows if row["base"] == which] exact = [row for row in rows if row["base"] == which]
if exact: if exact:
return exact[0] return exact[0]