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
if which in ("", "last"):
return rows[-1]
if which.isdigit():
index = int(which)
return rows[-index] if 0 < index <= len(rows) else None
# A stem is all digits too, so a number is only a position while there are
# that many meetings to count back through. Anything larger is a date
# 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]
if exact:
return exact[0]