estimate: itemize a Takeout's calendars and contacts too #71

Merged
jcoffey-dev merged 1 commits from feat/estimate-takeout-pim into main 2026-11-12 17:31:08 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 6559b9812d estimate: itemize a Takeout's calendars and contacts too
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 4m51s
ci / announce (pull_request) Skipped
Takeout's --estimate counted and sized the mail but left calendars and
contacts to the plain file counts. Now it reads the .ics and .vcf files
as well: it counts the events and contacts that are new since the
archive was last filled and sums the bytes of the record each would
store, writing nothing.

Each kind dedupes by the same key the import keeps -- events by their
UID (synthesised from the file path and ordinal when an event has none,
exactly as the import does), contacts by the card UID -- so an object
that appears in two files, or one already imported, counts once. A
re-estimate of a part-filled archive reports only what is left.

The archived-id lookup the three scans share is pulled into one helper,
archived_keys. The synthetic-Takeout estimate test now asserts new
events and contacts are counted and sized, and that a re-estimate after
import finds nothing new of any kind.
2026-11-12 10:00:58 -07:00