Skip to main content

Module cache_location

Module cache_location 

Source
Expand description

Where a library’s rebuildable caches live: by default inside the library (<library>/.photovault/thumbnails and .../faces), or on this computer.

A library on an external hard drive keeps tens of thousands of small thumbnail and face-crop files, and spinning disks are slow at exactly that. Those files can always be rebuilt from the photos, so this computer may keep them on its own (usually much faster) disk instead. The database stays with the photos, so the library remains portable.

The choice belongs to the computer, not the library: it is kept in this computer’s settings under the library’s id. Another computer simply uses the copies inside the library, or rebuilds missing ones.

Stored paths never change (.photovault/thumbnails/...); they are resolved here, so every reader and writer that goes through crate::services::path_util::safe_join_relative, thumbnails_dir or faces_dir follows the choice.

Constants§

MOVABLE
The caches that may move: rebuildable, many small files.

Functions§

copy_caches
Copy the movable caches from from to to (each holding thumbnails/ and faces/), skipping files already there at the same size. Stops early, without error, when cancel is set. Returns files copied.
default_base
Where this computer keeps a library’s caches unless the user picks another folder.
faces_dir
Where face crops are written for this library.
library_id
This library’s id, made on first use. It names the library in this computer’s settings even when its drive letter or mount point changes.
local_base
The folder on this computer holding root’s caches, if they moved.
place
Keep root’s caches in base from now on, or (with None) inside the library again.
thumbnails_dir
Where thumbnails are written for this library.

Type Aliases§

CopyProgress
Progress through a copy: files done so far, and the total.