refactor(state): _cooldown_row shape helper; per-model usage kwargs via field set; small folds

This commit is contained in:
Teknium
2026-09-02 17:17:16 -07:00
parent d77f3ad79b
commit 1991695511
3 changed files with 50 additions and 70 deletions
+3 -6
View File
@@ -203,9 +203,6 @@ class SessionTitlesMixin:
)
if not rows:
return base
max_num = 1 # the unnumbered original counts as #1
for row in rows:
m = re.match(r'^.* #(\d+)$', row["title"])
if m:
max_num = max(max_num, int(m.group(1)))
return f"{base} #{max_num + 1}"
# The unnumbered original counts as #1.
numbers = [int(m.group(1)) for m in (re.match(r'^.* #(\d+)$', row["title"]) for row in rows) if m]
return f"{base} #{max([1, *numbers]) + 1}"