Fix recipe listing, effects count, and add nav counts to all pages
- Fix list_by_type to return node_id (IPFS CID) instead of local hash - Fix effects count on home page (count from _effects/ directory) - Add nav_counts to all page templates (recipes, effects, runs, media, storage) - Add editable metadata section to cache/media detail page - Show more metadata on recipe detail page (ID, IPFS CID, step count) - Update tests for new list_by_type behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -519,19 +519,20 @@ class L1CacheManager:
|
||||
|
||||
def list_by_type(self, node_type: str) -> List[str]:
|
||||
"""
|
||||
List content hashes of all cached files of a specific type.
|
||||
List CIDs of all cached files of a specific type.
|
||||
|
||||
Args:
|
||||
node_type: Type to filter by (e.g., "recipe", "upload", "effect")
|
||||
|
||||
Returns:
|
||||
List of content hashes
|
||||
List of CIDs (IPFS CID if available, otherwise node_id)
|
||||
"""
|
||||
hashes = []
|
||||
cids = []
|
||||
for entry in self.cache.list_entries():
|
||||
if entry.node_type == node_type and entry.cid:
|
||||
hashes.append(entry.cid)
|
||||
return hashes
|
||||
if entry.node_type == node_type:
|
||||
# Return node_id which is the IPFS CID for uploaded content
|
||||
cids.append(entry.node_id)
|
||||
return cids
|
||||
|
||||
# ============ Activity Tracking ============
|
||||
|
||||
|
||||
Reference in New Issue
Block a user