Function scan

Source
pub fn scan(
    roots: &[PathBuf],
    previous: Option<&Catalog>,
    options: &ScanOptions,
    on_progress: impl FnMut(Progress) + Send,
) -> Result<(Catalog, ScanReport)>
Expand description

Scans the given folders and builds a catalog.

previous enables incremental reuse and retention of inaccessible paths. To reread accessible files while keeping that evidence, set ScanOptions::force_read. Passing None starts without any prior data.

Only ordinary files are opened as audio. Roots and directory entries are traversed in native path order so followed directory aliases choose the same spelling. A root that cannot be represented exactly as UTF-8 is an invalid input; unrepresentable entries are reported and skipped.

Fresh reads compare filesystem metadata before and after tag parsing. An observed rewrite is reported as temporary unavailability rather than cached or mistaken for permanent corruption. This is a filesystem snapshot check, not a content hash or a transaction with concurrent file writers.