Skip to content

Commit

Permalink
feat: added basic PhotoMeta object to core_types
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Mar 10, 2024
1 parent 0d84f96 commit 6e21b08
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions crates/core_types/src/photo.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};

/// The table name for the photo table.
Expand All @@ -18,13 +20,26 @@ pub struct PhotoRecordId(pub ulid::Ulid);
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Photo {
/// The record ID.
pub id: PhotoRecordId,
pub id: PhotoRecordId,
/// The photo group that contains this photo.
pub group: PhotoGroupRecordId,
pub group: PhotoGroupRecordId,
/// The photo's artifacts.
pub artifacts: PhotoArtifacts,
pub artifacts: PhotoArtifacts,
/// Data derived from the photo's EXIF data.
pub photo_meta: PhotoMeta,
/// Object metadata.
pub meta: crate::ObjectMeta,
pub meta: crate::ObjectMeta,
}

/// Photo metadata derived from EXIF data.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PhotoMeta {
/// The date and time the photo was taken.
pub date_time: Option<chrono::DateTime<chrono::Utc>>,
/// The GPS coordinates where the photo was taken.
pub gps: Option<(f64, f64)>,
/// Extra EXIF data.
pub extra: HashMap<String, String>,
}

/// The artifacts for a photo. Not a table.
Expand Down

0 comments on commit 6e21b08

Please sign in to comment.