From e395f791cfbaad8b37bf1ca46c641fa15c518fc1 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sun, 5 Apr 2026 18:14:03 +0000 Subject: [PATCH] Fix: Make TimeBucketAssetResponse fields optional to handle null values from API --- src/models/mod.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/models/mod.rs b/src/models/mod.rs index 8e30edd..f328ec5 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -293,41 +293,41 @@ pub struct TimeBucketResponse { #[serde(rename_all = "camelCase")] pub struct TimeBucketAssetResponse { /// Array of city names extracted from EXIF GPS data - pub city: Vec>, + pub city: Option>>, /// Array of country names extracted from EXIF GPS data - pub country: Vec>, + pub country: Option>>, /// Array of video durations in HH:MM:SS format (null for images) - pub duration: Vec>, + pub duration: Option>>, /// Array of file creation timestamps in UTC - pub file_created_at: Vec, + pub file_created_at: Option>, /// Array of asset IDs in the time bucket - pub id: Vec, + pub id: Option>, /// Array indicating whether each asset is favorited - pub is_favorite: Vec, + pub is_favorite: Option>, /// Array indicating whether each asset is an image (false for videos) - pub is_image: Vec, + pub is_image: Option>, /// Array indicating whether each asset is in the trash - pub is_trashed: Vec, + pub is_trashed: Option>, /// Array of latitude coordinates extracted from EXIF GPS data - pub latitude: Vec>, + pub latitude: Option>>, /// Array of live photo video asset IDs (null for non-live photos) - pub live_photo_video_id: Vec>, + pub live_photo_video_id: Option>>, /// Array of UTC offset hours at the time each photo was taken - pub local_offset_hours: Vec, + pub local_offset_hours: Option>, /// Array of longitude coordinates extracted from EXIF GPS data - pub longitude: Vec>, + pub longitude: Option>>, /// Array of owner IDs for each asset - pub owner_id: Vec, + pub owner_id: Option>, /// Array of projection types for 360° content - pub projection_type: Vec>, + pub projection_type: Option>>, /// Array of aspect ratios (width/height) for each asset - pub ratio: Vec, + pub ratio: Option>, /// Array of stack information as [stackId, assetCount] tuples - pub stack: Vec>>, + pub stack: Option>>>, /// Array of BlurHash strings for generating asset previews - pub thumbhash: Vec>, + pub thumbhash: Option>>, /// Array of visibility statuses for each asset - pub visibility: Vec, + pub visibility: Option>, } #[cfg(test)]