mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix: use full field name in build_cache grouping
This commit is contained in:
parent
8800a3c8b3
commit
a278637673
1 changed files with 2 additions and 1 deletions
|
|
@ -65,11 +65,12 @@ def _row_to_dict(row: sqlite3.Row) -> dict[str, Any]:
|
|||
|
||||
def build_cache(conn: sqlite3.Connection) -> dict[str, Any]:
|
||||
"""Read all non-deleted annotations and group by paper_id."""
|
||||
conn.row_factory = sqlite3.Row
|
||||
rows = conn.execute(CACHE_QUERY).fetchall()
|
||||
by_paper: dict[str, list[dict[str, Any]]] = {}
|
||||
for r in rows:
|
||||
d = _row_to_dict(r)
|
||||
pid = d["pid"]
|
||||
pid = d["paper_id"]
|
||||
if pid not in by_paper:
|
||||
by_paper[pid] = []
|
||||
by_paper[pid].append(d)
|
||||
|
|
|
|||
Loading…
Reference in a new issue