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:
@@ -29,7 +29,7 @@ class RecipeUploadRequest(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class RecipeRunRequest(BaseModel):
|
class RecipeRunRequest(BaseModel):
|
||||||
inputs: List[str] = []
|
inputs: dict = {}
|
||||||
|
|
||||||
|
|
||||||
def get_recipe_service():
|
def get_recipe_service():
|
||||||
|
|||||||
@@ -108,3 +108,22 @@ class CacheService:
|
|||||||
def get_ipfs_cid(self, content_hash: str) -> Optional[str]:
|
def get_ipfs_cid(self, content_hash: str) -> Optional[str]:
|
||||||
"""Get IPFS CID for cached content."""
|
"""Get IPFS CID for cached content."""
|
||||||
return self.cache.get_ipfs_cid(content_hash)
|
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", [])
|
||||||
|
|||||||
Reference in New Issue
Block a user