Fix lazy audio path resolution for GPU streaming
Audio playback path was being resolved during parsing when database may not be ready, causing fallback to non-existent path. Now resolves lazily when stream starts, matching how audio analyzer works. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,11 +84,15 @@ def resolve_asset(ref: str, actor_id: Optional[str] = None) -> Optional[Path]:
|
||||
logger.info(f"Resolved '{ref}' via friendly name to {path}")
|
||||
return path
|
||||
|
||||
# File not in local cache - try fetching from IPFS
|
||||
# The CID from friendly_names is an IPFS CID
|
||||
print(f"RESOLVE_ASSET: file not local, trying IPFS fetch for {cid}", file=sys.stderr)
|
||||
# File not in local cache - look up IPFS CID and fetch
|
||||
# The cid from friendly_names is internal, need to get ipfs_cid from cache_items
|
||||
ipfs_cid = _resolve_loop.run_until_complete(database.get_ipfs_cid(cid))
|
||||
if not ipfs_cid or ipfs_cid == cid:
|
||||
# No separate IPFS CID, try using the cid directly (might be IPFS CID)
|
||||
ipfs_cid = cid
|
||||
print(f"RESOLVE_ASSET: file not local, trying IPFS fetch for {ipfs_cid}", file=sys.stderr)
|
||||
import ipfs_client
|
||||
content = ipfs_client.get_bytes(cid, use_gateway_fallback=True)
|
||||
content = ipfs_client.get_bytes(ipfs_cid, use_gateway_fallback=True)
|
||||
if content:
|
||||
# Save to local cache
|
||||
import tempfile
|
||||
|
||||
Reference in New Issue
Block a user