pub fn usage(
home: &Path,
db: Option<&Path>,
thumbs: &Path,
lib_embeddings: Option<&Path>,
) -> Vec<Usage>Expand description
Everything videre stores, largest first.
db is passed in because the database is the one piece that does not have
to live under the home directory: --db puts it anywhere.
:warning: Embeddings are per library, not per home. They live in
<home>/embeddings/<db stem>-<hash16>, so summing the whole embeddings
directory attributes every library’s vectors to whichever one is being
reported. lib_embeddings is this library’s directory; anything else under
there is reported separately and labelled as belonging to other libraries,
because it is real disk use but not this library’s.
:warning: The thumbnail cache is not always under the home directory.
With VIDERE_HOME unset it lives in the platform cache directory, so a
report that only walked the home would silently omit the largest deletable
thing videre owns. That is why it is a parameter rather than being looked up
here: thumb_cache::cache_dir() reads the environment, and a function whose
result depends on an env var it never mentions cannot be tested or reasoned
about. Callers pass it in.