Fix CacheService list_media and recipe inputs type

- Add list_media method to CacheService
- Change recipe run inputs from List to dict

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-01-11 13:28:27 +00:00
parent 4f011a66ff
commit 8591faf0fc
2 changed files with 20 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ class RecipeUploadRequest(BaseModel):
class RecipeRunRequest(BaseModel):
inputs: List[str] = []
inputs: dict = {}
def get_recipe_service():

View File

@@ -108,3 +108,22 @@ class CacheService:
def get_ipfs_cid(self, content_hash: str) -> Optional[str]:
"""Get IPFS CID for cached content."""
return self.cache.get_ipfs_cid(content_hash)
async def list_media(
self,
actor_id: str = None,
username: str = None,
offset: int = 0,
limit: int = 24,
media_type: str = None,
) -> List[Dict[str, Any]]:
"""List media items in cache."""
# Use list_items internally, converting offset to page
page = (offset // limit) + 1 if limit > 0 else 1
result = await self.list_items(
actor_id=actor_id or username,
media_type=media_type,
page=page,
limit=limit,
)
return result.get("items", [])