Fix lazy audio path resolution for GPU streaming
Some checks are pending
GPU Worker CI/CD / test (push) Waiting to run
GPU Worker CI/CD / deploy (push) Blocked by required conditions

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:
giles
2026-02-04 11:32:04 +00:00
parent ef3638d3cf
commit ed617fcdd6
9 changed files with 159 additions and 57 deletions

View File

@@ -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