From 1b12ae0c2fa32e3bc51850e8bac7306872ee894d Mon Sep 17 00:00:00 2001 From: yusufipk Date: Sat, 1 Aug 2026 20:06:35 +0700 Subject: [PATCH] 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. --- cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli.py b/cli.py index 85a63dc..b584458 100644 --- a/cli.py +++ b/cli.py @@ -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]