Coverage for src/lilbee/app/titles.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-11-06 08:17 +0000

1"""The stored titles of sources, as every surface that names a source shows them.""" 

2 

3from __future__ import annotations 

4 

5from collections.abc import Iterable 

6 

7from lilbee.app.services import get_services 

8from lilbee.core.web_names import is_web_source 

9 

10 

11def stored_web_titles(names: Iterable[str]) -> dict[str, str]: 

12 """The stored title of each crawled page among *names* that has one. 

13 

14 A list with no crawled page reads nothing, so it never starts the services. 

15 """ 

16 pages = [name for name in names if is_web_source(name)] 

17 return get_services().store.web_titles(pages) if pages else {}