Add integration testing infrastructure with Podman Compose
- Add docker/podman-compose.yml for Immich server (no ML) - Add test-data/sample-photos/ with 3 public domain images - Add scripts/start-immich.sh for container startup + admin/API key creation - Add scripts/seed-data.sh for uploading test photos and creating albums - Add scripts/stop-immich.sh for cleanup with volume destruction - Add scripts/run-example.sh wrapper (fixed env var export) - Update examples to use IMMICH_URL and IMMICH_API_KEY env vars - Add .github/workflows/integration-test.yml for CI - Update assets.list() to use /search/metadata endpoint - Update AGENTS.md with example running instructions - Add 5 new examples: search_metadata, album_management, timeline_browsing, delete_assets, server_info
This commit is contained in:
@@ -6,7 +6,7 @@ use std::path::Path;
|
||||
use crate::{
|
||||
Client,
|
||||
error::{ImmichError, Result},
|
||||
models::{AssetId, AssetMediaSize, AssetResponse, AssetUploadResponse, DeleteAssetsRequest},
|
||||
models::{AssetId, AssetMediaSize, AssetResponse, AssetUploadResponse, DeleteAssetsRequest, MetadataSearchRequest, SearchResponse},
|
||||
};
|
||||
|
||||
/// Response from downloading a thumbnail containing image data and metadata
|
||||
@@ -160,24 +160,26 @@ impl ListAssetsBuilder {
|
||||
|
||||
/// Execute the request
|
||||
pub async fn execute(self) -> Result<Vec<AssetResponse>> {
|
||||
let mut req = self.client.get("/assets");
|
||||
let req = self.client.post("/search/metadata");
|
||||
|
||||
let mut body = MetadataSearchRequest::default();
|
||||
|
||||
if let Some(album_id) = self.album_id {
|
||||
req = req.query(&[("albumId", album_id.to_string())]);
|
||||
body.album_ids = Some(vec![album_id]);
|
||||
}
|
||||
|
||||
if let Some(is_favorite) = self.is_favorite {
|
||||
req = req.query(&[("isFavorite", is_favorite.to_string())]);
|
||||
body.is_favorite = Some(is_favorite);
|
||||
}
|
||||
|
||||
if let Some(is_trashed) = self.is_trashed {
|
||||
req = req.query(&[("isTrashed", is_trashed.to_string())]);
|
||||
body.with_deleted = Some(is_trashed);
|
||||
}
|
||||
|
||||
let response = self.client.execute(req.build()?).await?;
|
||||
let assets: Vec<AssetResponse> = response.json().await?;
|
||||
let response = self.client.execute(req.json(&body).build()?).await?;
|
||||
let search_result: SearchResponse = response.json().await?;
|
||||
|
||||
Ok(assets)
|
||||
Ok(search_result.assets.items)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user