Skip to main content

Module local_source

Module local_source 

Source
Expand description

Local file enumeration for the library view.

Walks the user’s currently configured watch paths, applies the same filtering rules used by the sync engine (FolderRules + supported-media extensions), and produces a list of LocalAsset rows that the library grid can display alongside (or instead of) remote Immich assets.

Unlike the sync path, this module does NOT compute checksums on enumeration — that would be too expensive for browsing. Sync state is matched by looking up SyncIndex.stored_checksum(path) for paths the engine has already hashed; assets the user hasn’t synced yet show as “Local only”.

Structs§

LocalAsset
A single file enumerated from the user’s watched folders.

Functions§

build_asset 🔒
Parse metadata details and construct a typed LocalAsset for a file path.
enumerate_blocking 🔒
Walk directories on a thread pool thread to search for media files.
enumerate_local
Walk every configured watch path and return matching media files.
enumerate_local_for_entry
Enumerate only the watch entries matching entry_path. Used by the album-scoped Local/Unified views so a linked album’s view stays bounded to its own folder instead of spilling assets from sibling albums.
filter_by_filename
Apply a case-insensitive filename substring filter, matching the spec’s “Local Search: file name based” requirement.
format_modified 🔒
Convert a file modification timestamp into standard ISO-8601 formatting.
local_sync_state
Decide the sync-state badge for a local asset.