fix: preserve short release titles and cover source generation contracts
Some checks failed
ci / test (3.10) (push) Has been cancelled
ci / test (3.11) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled

This commit is contained in:
Vlad Gothbreach
2026-10-27 02:09:37 +03:00
parent 16512bf4a1
commit c1d2d1bbda
3 changed files with 73 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ def _item(src, kind, url, title, text="", author="", published="", extra=None):
ex["tags"] = list(src.tags)
t = _txt(title)
body = _txt(text)
if sum(ch.isalpha() for ch in t) < 12 and body:
if body and (not t or getattr(src, "adapter", "").startswith("tg_")) and sum(ch.isalpha() for ch in t) < 12:
cand = [ln for ln in body.splitlines() if sum(ch.isalpha() for ch in ln) >= 12]
if cand:
t = max(cand, key=len)[:140]