Skip to main content

Module default_album

Module default_album 

Source
Expand description

Default-album resolution — where an import lands when the user files it nowhere (SSoT: Organization — The Default Album).

Capsule guarantees every owner a default album: a de facto, nameless container whose id is derived from the account master key, so a device can locate it from the master key alone. Which container is currently the default may be re-pointed by a non-secret default_album_id on the owner record, and an explicit pick at import time overrides both.

resolve_default_album is the one place that order is encoded, and it records which rule fired (ResolutionRule) so a surprising destination is explainable after the fact. It always resolves to a container — a view can never be an import destination.

v1 scope. The doc’s full order interposes two settings-document rows — scope_id override, then per-SourceKind default — between the explicit pick and the owner pointer. Those rows ship post-v1 with the library-settings document; v1 ships the base order below. The import’s Scope is carried through and recorded now, so the two lookups slot in at the marked seam without changing this signature or any caller.

Structs§

DefaultAlbumContext
Everything the resolution order reads. Each field is one rule’s input, in priority order; scope is carried for traceability and for the post-v1 override rows.
ResolvedAlbum
The album an import will land in, and the rule that chose it.

Enums§

DefaultAlbumError
Failure to resolve a destination album.
ResolutionRule
Which rule of the resolution order chose the destination album. Recorded on every resolution so a surprising destination is explainable after the fact.

Functions§

resolve_default_album
Resolve the destination album for an import, first match wins (SSoT: Organization — The Default Album).