pub struct PhotoRepo<'a> { /* private fields */ }Expand description
Photo repository for database operations
Implementations§
Source§impl<'a> PhotoRepo<'a>
impl<'a> PhotoRepo<'a>
pub fn new(conn: &'a Connection) -> Self
Sourcepub fn insert_batch_stub(&self, photos: &[PhotoInsert]) -> SqliteResult<usize>
pub fn insert_batch_stub(&self, photos: &[PhotoInsert]) -> SqliteResult<usize>
Batch insert stub rows (streaming scanner Phase 1B).
Uses INSERT OR IGNORE so an idempotent re-scan never blows away
metadata that Phase 2+ already filled in. Only sets the columns
known at walk time; everything else (EXIF, thumbnail, geocoding)
is updated later by the pipeline workers.
Sourcepub fn insert_batch(&self, photos: &[PhotoInsert]) -> SqliteResult<usize>
pub fn insert_batch(&self, photos: &[PhotoInsert]) -> SqliteResult<usize>
Batch insert photos within a transaction
pub fn count_timeline_visible(&self, show_stacks: bool) -> SqliteResult<i64>
Sourcepub fn count_pending_metadata(&self) -> SqliteResult<i64>
pub fn count_pending_metadata(&self) -> SqliteResult<i64>
Photos awaiting EXIF / geocoding extraction (Phase 2 of the streaming scanner). Drives the “Resume reading metadata” banner.
Sourcepub fn count_pending_thumbnails(&self) -> SqliteResult<i64>
pub fn count_pending_thumbnails(&self) -> SqliteResult<i64>
Photos awaiting thumbnail generation (Phase 3).
Sourcepub fn get_all_by_date(
&self,
limit: i64,
offset: i64,
) -> SqliteResult<Vec<Photo>>
pub fn get_all_by_date( &self, limit: i64, offset: i64, ) -> SqliteResult<Vec<Photo>>
Get all photos ordered by date
Sourcepub fn get_by_ids(&self, photo_ids: &[i64]) -> SqliteResult<Vec<Photo>>
pub fn get_by_ids(&self, photo_ids: &[i64]) -> SqliteResult<Vec<Photo>>
Get photos by IDs ordered by date (descending).
pub fn set_favorite(&self, id: i64, is_favorite: bool) -> SqliteResult<usize>
pub fn count_favorites(&self) -> SqliteResult<i64>
pub fn favorites_album_summary( &self, ) -> SqliteResult<Option<FavoriteAlbumSummary>>
Source§impl<'a> PhotoRepo<'a>
impl<'a> PhotoRepo<'a>
Sourcepub fn list_after(
&self,
cursor: Option<(Option<DateTime<Utc>>, i64)>,
limit: i64,
include_trashed: bool,
show_stacks: bool,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_after( &self, cursor: Option<(Option<DateTime<Utc>>, i64)>, limit: i64, include_trashed: bool, show_stacks: bool, ) -> SqliteResult<Vec<PhotoLite>>
Cursor-paginated timeline list. Cursor key is (date_taken, id)
descending. NULL date_taken sorts last via SQLite’s IS NULL.
limit is clamped by the caller; this just trusts it.
Sourcepub fn list_at_offset(
&self,
offset: i64,
limit: i64,
include_trashed: bool,
show_stacks: bool,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_at_offset( &self, offset: i64, limit: i64, include_trashed: bool, show_stacks: bool, ) -> SqliteResult<Vec<PhotoLite>>
Offset-addressed timeline window. Used only for fast jumps into very large timelines; cursor paging remains the normal path.
pub fn timeline_neighbors( &self, photo_id: i64, show_stacks: bool, ) -> SqliteResult<Option<TimelineNeighbors>>
Sourcepub fn list_after_by_album(
&self,
album_id: i64,
cursor: Option<(Option<DateTime<Utc>>, i64)>,
limit: i64,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_after_by_album( &self, album_id: i64, cursor: Option<(Option<DateTime<Utc>>, i64)>, limit: i64, ) -> SqliteResult<Vec<PhotoLite>>
Cursor-paginated photos in a specific album, ordered by date.
Sourcepub fn list_after_favorites(
&self,
cursor: Option<(Option<DateTime<Utc>>, i64)>,
limit: i64,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_after_favorites( &self, cursor: Option<(Option<DateTime<Utc>>, i64)>, limit: i64, ) -> SqliteResult<Vec<PhotoLite>>
Cursor-paginated favorite photos. This backs the virtual
Favorites album without writing synthetic rows to albums.
Sourcepub fn list_after_by_person(
&self,
cluster_id: i64,
cursor: Option<(Option<DateTime<Utc>>, i64)>,
limit: i64,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_after_by_person( &self, cluster_id: i64, cursor: Option<(Option<DateTime<Utc>>, i64)>, limit: i64, ) -> SqliteResult<Vec<PhotoLite>>
Cursor-paginated photos featuring a person (face cluster).
Sourcepub fn list_after_by_date(
&self,
start_iso: &str,
end_iso: &str,
cursor: Option<(Option<DateTime<Utc>>, i64)>,
limit: i64,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_after_by_date( &self, start_iso: &str, end_iso: &str, cursor: Option<(Option<DateTime<Utc>>, i64)>, limit: i64, ) -> SqliteResult<Vec<PhotoLite>>
Cursor-paginated photos in a half-open date range: [start, end).
Sourcepub fn list_after_by_place(
&self,
city: Option<&str>,
country: Option<&str>,
cursor: Option<(Option<DateTime<Utc>>, i64)>,
limit: i64,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_after_by_place( &self, city: Option<&str>, country: Option<&str>, cursor: Option<(Option<DateTime<Utc>>, i64)>, limit: i64, ) -> SqliteResult<Vec<PhotoLite>>
Cursor-paginated photos in a place (city and/or country, both optional).
Sourcepub fn list_in_bounds(
&self,
north: f64,
south: f64,
east: f64,
west: f64,
cap: i64,
) -> SqliteResult<Vec<PhotoLite>>
pub fn list_in_bounds( &self, north: f64, south: f64, east: f64, west: f64, cap: i64, ) -> SqliteResult<Vec<PhotoLite>>
Photos within a lat/lng bounding box that have GPS coordinates.
Used by map.pins for server-side aggregation.
Bounds are inclusive on all sides. Returns a hard cap of cap rows.
Auto Trait Implementations§
impl<'a> Freeze for PhotoRepo<'a>
impl<'a> !RefUnwindSafe for PhotoRepo<'a>
impl<'a> !Send for PhotoRepo<'a>
impl<'a> !Sync for PhotoRepo<'a>
impl<'a> Unpin for PhotoRepo<'a>
impl<'a> UnsafeUnpin for PhotoRepo<'a>
impl<'a> !UnwindSafe for PhotoRepo<'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