pub struct BurstRepo<'a> { /* private fields */ }Expand description
Burst repository
Implementations§
Source§impl<'a> BurstRepo<'a>
impl<'a> BurstRepo<'a>
pub fn new(conn: &'a Connection) -> Self
Sourcepub fn sync_burst_groups(
&self,
groups: &[(String, String, Vec<i64>)],
) -> SqliteResult<()>
pub fn sync_burst_groups( &self, groups: &[(String, String, Vec<i64>)], ) -> SqliteResult<()>
Sync burst groups from detection results, preserving user decisions.
Uses merge-based approach: existing groups whose photo sets match are kept
intact (preserving is_suggested_best), new groups are created, and groups
that no longer match any detection result are removed.
Sourcepub fn upsert_burst_groups(
&self,
groups: &[(String, String, Vec<i64>)],
) -> SqliteResult<usize>
pub fn upsert_burst_groups( &self, groups: &[(String, String, Vec<i64>)], ) -> SqliteResult<usize>
Insert any supplied burst groups that do not already exist by
member set. Does not delete old groups. Used for live streaming
during detection; a full completed run should still call
sync_burst_groups to prune stale results.
pub fn upsert_burst_groups_collecting_inserted( &self, groups: &[(String, String, Vec<i64>)], ) -> SqliteResult<Vec<Vec<i64>>>
pub fn delete_unresolved_groups_by_member_sets( &self, groups: &[Vec<i64>], ) -> SqliteResult<usize>
Sourcepub fn ensure_suggested_best(&self, group_id: i64) -> SqliteResult<()>
pub fn ensure_suggested_best(&self, group_id: i64) -> SqliteResult<()>
If the group has no is_suggested_best = TRUE member, pick one.
Targets the earliest member (by photos.date_taken, falling back to
bgm.rowid) so the choice is stable across calls. Idempotent —
callers can run it on every read.
Sourcepub fn set_suggested_best(
&self,
group_id: i64,
photo_id: i64,
) -> SqliteResult<()>
pub fn set_suggested_best( &self, group_id: i64, photo_id: i64, ) -> SqliteResult<()>
Set the suggested best photo for a group (atomic)
Sourcepub fn get_all_groups(&self) -> SqliteResult<Vec<BurstGroupRecord>>
pub fn get_all_groups(&self) -> SqliteResult<Vec<BurstGroupRecord>>
Get all burst groups + the first 4 thumbnails per group for the listing card’s 2×2 stack. Two queries (one for groups, one for thumbs) is fine here — the listing is small and we keep the SQL plain rather than wrestling a window function.
pub fn get_groups( &self, limit: i64, offset: i64, ) -> SqliteResult<Vec<BurstGroupRecord>>
Sourcepub fn get_group_members(
&self,
group_id: i64,
) -> SqliteResult<Vec<BurstGroupMemberRecord>>
pub fn get_group_members( &self, group_id: i64, ) -> SqliteResult<Vec<BurstGroupMemberRecord>>
Get members of a burst group
Sourcepub fn get_photos_to_trash(&self, group_id: i64) -> SqliteResult<Vec<i64>>
pub fn get_photos_to_trash(&self, group_id: i64) -> SqliteResult<Vec<i64>>
Get non-best photos to potentially trash
Sourcepub fn delete_group(&self, group_id: i64) -> SqliteResult<()>
pub fn delete_group(&self, group_id: i64) -> SqliteResult<()>
Delete a burst group
Sourcepub fn dismiss_group(&self, group_id: i64) -> SqliteResult<()>
pub fn dismiss_group(&self, group_id: i64) -> SqliteResult<()>
Mark a burst group as handled without deleting its member set.
Auto Trait Implementations§
impl<'a> Freeze for BurstRepo<'a>
impl<'a> !RefUnwindSafe for BurstRepo<'a>
impl<'a> !Send for BurstRepo<'a>
impl<'a> !Sync for BurstRepo<'a>
impl<'a> Unpin for BurstRepo<'a>
impl<'a> UnsafeUnpin for BurstRepo<'a>
impl<'a> !UnwindSafe for BurstRepo<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more