Some checks failed
API Docs (Node.js Express) / test (16) (push) Failing after 5m29s
API Docs (Node.js Express) / test (18) (push) Failing after 5m25s
API Docs (Node.js Express) / test (20) (push) Failing after 1m4s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 4m52s
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 5m1s
LabFusion CI/CD Pipeline / api-docs (push) Failing after 5m12s
LabFusion CI/CD Pipeline / frontend (push) Failing after 6m39s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 34s
Docker Build and Push / security-scan (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 1m33s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 35s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 5m20s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 5m27s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 5m50s
Docker Build and Push / deploy-staging (push) Has been skipped
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
71 lines
2.1 KiB
Python
71 lines
2.1 KiB
Python
from datetime import datetime
|
|
|
|
from fastapi import APIRouter, HTTPException
|
|
|
|
from models.schemas import ImmichAsset, ImmichAssetsResponse
|
|
from services.config import SERVICES
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get(
|
|
"/immich/assets",
|
|
response_model=ImmichAssetsResponse,
|
|
summary="Get Immich Assets",
|
|
description="Retrieve photo assets from Immich",
|
|
responses={
|
|
200: {"description": "Successfully retrieved assets"},
|
|
503: {"description": "Immich integration not configured"},
|
|
},
|
|
tags=["Immich"],
|
|
)
|
|
async def get_immich_assets():
|
|
"""Get Immich photo assets including metadata, tags, and face detection results"""
|
|
if not SERVICES["immich"]["enabled"]:
|
|
raise HTTPException(
|
|
status_code=503,
|
|
detail="Immich integration not configured. Please set IMMICH_API_KEY environment variable.",
|
|
)
|
|
|
|
# This would make actual API calls to Immich
|
|
# For now, return mock data
|
|
return ImmichAssetsResponse(
|
|
assets=[
|
|
ImmichAsset(
|
|
id="asset_123",
|
|
filename="photo_001.jpg",
|
|
created_at=datetime.now().isoformat(),
|
|
tags=["person", "outdoor"],
|
|
faces=["Alice", "Bob"],
|
|
)
|
|
]
|
|
)
|
|
|
|
|
|
@router.get(
|
|
"/immich/albums",
|
|
summary="Get Immich Albums",
|
|
description="Get list of Immich albums",
|
|
responses={
|
|
200: {"description": "Successfully retrieved albums"},
|
|
503: {"description": "Immich integration not configured"},
|
|
},
|
|
tags=["Immich"],
|
|
)
|
|
async def get_immich_albums():
|
|
"""Get list of Immich albums"""
|
|
if not SERVICES["immich"]["enabled"]:
|
|
raise HTTPException(
|
|
status_code=503,
|
|
detail="Immich integration not configured. Please set IMMICH_API_KEY environment variable.",
|
|
)
|
|
|
|
# This would make actual API calls to Immich
|
|
# For now, return mock data
|
|
return {
|
|
"albums": [
|
|
{"id": "album_1", "name": "Family Photos", "asset_count": 150},
|
|
{"id": "album_2", "name": "Vacation 2024", "asset_count": 75},
|
|
]
|
|
}
|