fix library collections: remove duplicates, correct counts
- Delete 2 empty duplicate "Supplemental" collections from bib.sqlite (ERRVP346 and JK6N2CLM — 0 items each, leftover from Zotero sync) - Fix export: item_count now shows direct items only (matches what the filter actually returns), not misleading recursive totals - Drop collections with 0 direct items from export (they produce empty results when clicked) Before: 19 collections, 3x "Supplemental", PFS showing 12429 After: 8 collections, 1x "Supplemental", PFS showing 254
This commit is contained in:
BIN
data/bib.sqlite
BIN
data/bib.sqlite
Binary file not shown.
@@ -42,9 +42,14 @@ def main() -> None:
|
||||
|
||||
store = Store(str(BIB_DB))
|
||||
items = store.list_items()
|
||||
collections = store.list_collections()
|
||||
raw_collections = store.list_collections()
|
||||
tags = store.list_tags()
|
||||
|
||||
# item_count from list_collections() is direct-only, which is what
|
||||
# the library page filter uses (i.collections.includes(key)).
|
||||
# Drop collections with 0 direct items — they produce empty results.
|
||||
collections = [c for c in raw_collections if c["item_count"] > 0]
|
||||
|
||||
serialized_items = []
|
||||
for item in items:
|
||||
abstract = item.abstract or ""
|
||||
|
||||
Reference in New Issue
Block a user