mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-26 11:09:23 -06:00
The left panel shows a count beside every album. Each catalog revision had every album counted again, and a smart album's count asks every photo of the library whether its rules hold: one pass over the library for each smart album after each keyword, rating or slider tick (about 25 ms an album in a library of 67,000 photos). `AlbumTally` (`crates/catalog/src/tally.rs`) keeps the counts and, for each smart album, which photos it holds. After a small edit each smart album asks only the photos the edit touched (`Catalog::touched_since`); an album of chosen photos is counted again only when a photo came, went or was deleted. Counted from every photo as before: new rules, a change to an album, a stack or the keyword list, an edit to more than 256 photos, another library, and each new minute while an album asks about "the last N days". What an album remembers is in proportion to the photos it holds: a bit a photo id while ids are close together, a set when they are far apart. The frame after a keyword in that library, both side panels open: about 54 ms -> 27 ms (156 ms before #1660). Tests: 900 random edits against eight smart albums (keywords, flags, ratings, labels, sliders, capture dates, file names, an album of chosen photos) and an ordinary one, the followed counts compared with `album_count` after each; a delete followed, three hundred photos counted whole; the members' bits at the edges and for ids far apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>