Fix: Make TimeBucketAssetResponse fields optional to handle null values from API

This commit is contained in:
Joakim Hulthe
2026-04-05 18:14:03 +00:00
parent 5855251f70
commit e395f791cf

View File

@@ -293,41 +293,41 @@ pub struct TimeBucketResponse {
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TimeBucketAssetResponse { pub struct TimeBucketAssetResponse {
/// Array of city names extracted from EXIF GPS data /// Array of city names extracted from EXIF GPS data
pub city: Vec<Option<String>>, pub city: Option<Vec<Option<String>>>,
/// Array of country names extracted from EXIF GPS data /// Array of country names extracted from EXIF GPS data
pub country: Vec<Option<String>>, pub country: Option<Vec<Option<String>>>,
/// Array of video durations in HH:MM:SS format (null for images) /// Array of video durations in HH:MM:SS format (null for images)
pub duration: Vec<Option<String>>, pub duration: Option<Vec<Option<String>>>,
/// Array of file creation timestamps in UTC /// Array of file creation timestamps in UTC
pub file_created_at: Vec<String>, pub file_created_at: Option<Vec<String>>,
/// Array of asset IDs in the time bucket /// Array of asset IDs in the time bucket
pub id: Vec<String>, pub id: Option<Vec<String>>,
/// Array indicating whether each asset is favorited /// Array indicating whether each asset is favorited
pub is_favorite: Vec<bool>, pub is_favorite: Option<Vec<bool>>,
/// Array indicating whether each asset is an image (false for videos) /// Array indicating whether each asset is an image (false for videos)
pub is_image: Vec<bool>, pub is_image: Option<Vec<bool>>,
/// Array indicating whether each asset is in the trash /// Array indicating whether each asset is in the trash
pub is_trashed: Vec<bool>, pub is_trashed: Option<Vec<bool>>,
/// Array of latitude coordinates extracted from EXIF GPS data /// Array of latitude coordinates extracted from EXIF GPS data
pub latitude: Vec<Option<f64>>, pub latitude: Option<Vec<Option<f64>>>,
/// Array of live photo video asset IDs (null for non-live photos) /// Array of live photo video asset IDs (null for non-live photos)
pub live_photo_video_id: Vec<Option<String>>, pub live_photo_video_id: Option<Vec<Option<String>>>,
/// Array of UTC offset hours at the time each photo was taken /// Array of UTC offset hours at the time each photo was taken
pub local_offset_hours: Vec<f64>, pub local_offset_hours: Option<Vec<f64>>,
/// Array of longitude coordinates extracted from EXIF GPS data /// Array of longitude coordinates extracted from EXIF GPS data
pub longitude: Vec<Option<f64>>, pub longitude: Option<Vec<Option<f64>>>,
/// Array of owner IDs for each asset /// Array of owner IDs for each asset
pub owner_id: Vec<String>, pub owner_id: Option<Vec<String>>,
/// Array of projection types for 360° content /// Array of projection types for 360° content
pub projection_type: Vec<Option<String>>, pub projection_type: Option<Vec<Option<String>>>,
/// Array of aspect ratios (width/height) for each asset /// Array of aspect ratios (width/height) for each asset
pub ratio: Vec<f64>, pub ratio: Option<Vec<f64>>,
/// Array of stack information as [stackId, assetCount] tuples /// Array of stack information as [stackId, assetCount] tuples
pub stack: Vec<Option<Vec<String>>>, pub stack: Option<Vec<Option<Vec<String>>>>,
/// Array of BlurHash strings for generating asset previews /// Array of BlurHash strings for generating asset previews
pub thumbhash: Vec<Option<String>>, pub thumbhash: Option<Vec<Option<String>>>,
/// Array of visibility statuses for each asset /// Array of visibility statuses for each asset
pub visibility: Vec<AssetVisibility>, pub visibility: Option<Vec<AssetVisibility>>,
} }
#[cfg(test)] #[cfg(test)]