mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user