pub struct AlbumRepo<'a> { /* private fields */ }Implementations§
Source§impl<'a> AlbumRepo<'a>
impl<'a> AlbumRepo<'a>
pub fn new(conn: &'a Connection) -> Self
Sourcepub fn create(&self, name: &str) -> SqliteResult<i64>
pub fn create(&self, name: &str) -> SqliteResult<i64>
Create a new album with the given name. Returns the new album ID.
Sourcepub fn create_with_source(
&self,
name: &str,
created_by: &str,
) -> SqliteResult<i64>
pub fn create_with_source( &self, name: &str, created_by: &str, ) -> SqliteResult<i64>
Create a new album and mark who created it.
Sourcepub fn delete(&self, album_id: i64) -> SqliteResult<()>
pub fn delete(&self, album_id: i64) -> SqliteResult<()>
Delete an album and its photo associations. Photos themselves are NOT trashed.
Sourcepub fn add_photos(
&self,
album_id: i64,
photo_ids: &[i64],
) -> SqliteResult<usize>
pub fn add_photos( &self, album_id: i64, photo_ids: &[i64], ) -> SqliteResult<usize>
Add photos to an album. Returns count of newly added (ignores duplicates).
Sourcepub fn remove_photos(
&self,
album_id: i64,
photo_ids: &[i64],
) -> SqliteResult<usize>
pub fn remove_photos( &self, album_id: i64, photo_ids: &[i64], ) -> SqliteResult<usize>
Remove photos from an album. Returns the number actually removed.
Sourcepub fn get_all(&self) -> SqliteResult<Vec<AlbumRecord>>
pub fn get_all(&self) -> SqliteResult<Vec<AlbumRecord>>
Get all albums ordered by most recently updated.
Sourcepub fn get_album_photo_ids(&self, album_id: i64) -> SqliteResult<Vec<i64>>
pub fn get_album_photo_ids(&self, album_id: i64) -> SqliteResult<Vec<i64>>
Get ordered photo IDs for an album.
Sourcepub fn get_albums_for_photo(
&self,
photo_id: i64,
) -> SqliteResult<Vec<(i64, String)>>
pub fn get_albums_for_photo( &self, photo_id: i64, ) -> SqliteResult<Vec<(i64, String)>>
Get album memberships for a photo: (album_id, album_name) pairs.
Sourcepub fn auto_pick_cover(&self, album_id: i64) -> SqliteResult<()>
pub fn auto_pick_cover(&self, album_id: i64) -> SqliteResult<()>
Auto-pick a cover photo for the album (prefers faces, landscape, newest).
Sourcepub fn refresh_stats(&self, album_id: i64) -> SqliteResult<()>
pub fn refresh_stats(&self, album_id: i64) -> SqliteResult<()>
Recompute persisted album counters and refresh auto-picked cover.
Auto Trait Implementations§
impl<'a> Freeze for AlbumRepo<'a>
impl<'a> !RefUnwindSafe for AlbumRepo<'a>
impl<'a> !Send for AlbumRepo<'a>
impl<'a> !Sync for AlbumRepo<'a>
impl<'a> Unpin for AlbumRepo<'a>
impl<'a> UnsafeUnpin for AlbumRepo<'a>
impl<'a> !UnwindSafe for AlbumRepo<'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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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