pub struct DuplicateRepo<'a> { /* private fields */ }Expand description
Duplicate repository
Implementations§
Source§impl<'a> DuplicateRepo<'a>
impl<'a> DuplicateRepo<'a>
pub fn new(conn: &'a Connection) -> Self
Sourcepub fn sync_duplicate_groups(
&self,
groups: &[(String, Vec<i64>, Option<i64>, &'static str)],
) -> SqliteResult<()>
pub fn sync_duplicate_groups( &self, groups: &[(String, Vec<i64>, Option<i64>, &'static str)], ) -> SqliteResult<()>
Create or update duplicate groups from detection results, preserving user decisions.
Uses merge-based approach: existing groups whose hash matches are kept
intact (preserving is_suggested_keep), new groups are created, and groups
whose hash no longer has duplicates are removed.
Sourcepub fn upsert_duplicate_groups(
&self,
groups: &[(String, Vec<i64>, Option<i64>, &'static str)],
) -> SqliteResult<()>
pub fn upsert_duplicate_groups( &self, groups: &[(String, Vec<i64>, Option<i64>, &'static str)], ) -> SqliteResult<()>
Insert or refresh the supplied groups without deleting groups absent from this batch. Used by long-running detectors so already-found results can stream into the UI and survive cancel.
Sourcepub fn get_all_groups(&self) -> SqliteResult<Vec<DuplicateGroupRecord>>
pub fn get_all_groups(&self) -> SqliteResult<Vec<DuplicateGroupRecord>>
Get all duplicate groups with member counts and a cover thumbnail.
The cover comes from the suggested-keep member when one is set, otherwise the lowest-id member. We pull the cover with a correlated sub-query so the result is one round-trip per listing.
pub fn get_groups( &self, limit: i64, offset: i64, ) -> SqliteResult<Vec<DuplicateGroupRecord>>
Sourcepub fn get_group_members(
&self,
group_id: i64,
) -> SqliteResult<Vec<DuplicateGroupMemberRecord>>
pub fn get_group_members( &self, group_id: i64, ) -> SqliteResult<Vec<DuplicateGroupMemberRecord>>
Get members of a specific group
Sourcepub fn set_keep_photo(&self, group_id: i64, photo_id: i64) -> SqliteResult<()>
pub fn set_keep_photo(&self, group_id: i64, photo_id: i64) -> SqliteResult<()>
Mark a photo as the one to keep in a group (atomic)
Sourcepub fn delete_group(&self, group_id: i64) -> SqliteResult<()>
pub fn delete_group(&self, group_id: i64) -> SqliteResult<()>
Delete a duplicate group (after resolution)
Sourcepub fn dismiss_group(&self, group_id: i64) -> SqliteResult<()>
pub fn dismiss_group(&self, group_id: i64) -> SqliteResult<()>
Mark a duplicate group as handled without deleting its hash.
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 photos to trash (all members except the one to keep)
Auto Trait Implementations§
impl<'a> Freeze for DuplicateRepo<'a>
impl<'a> !RefUnwindSafe for DuplicateRepo<'a>
impl<'a> !Send for DuplicateRepo<'a>
impl<'a> !Sync for DuplicateRepo<'a>
impl<'a> Unpin for DuplicateRepo<'a>
impl<'a> UnsafeUnpin for DuplicateRepo<'a>
impl<'a> !UnwindSafe for DuplicateRepo<'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