diff --git a/README.md b/README.md index 8cd4351..6b4c088 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,16 @@ result = pv.videos.wait_for_enrichment(video["id"], timeout=600) print(result["video"]["original_url"]) print(result["video"]["enrichment"].get("transcript")) print(result["video"]["enrichment"].get("storyboard")) + +audio = pv.audio.upload( + "episode.m4a", + visibility="private", + sign_expires_in=3600, + expires_in=604800, + idempotency_key="episode-v1", +) +print(audio["id"], audio["url"], audio["codec"], audio["duration_seconds"]) +fresh = pv.audio.sign_url(audio["id"], expires_in=3600) ``` Asyncio: @@ -74,12 +84,21 @@ async with AsyncPixelVault() as pv: | `videos.sign_url(id, expires_in=)` | Fresh private original, poster and available artifact URLs | | `videos.optimize(id)` / `enrich(id)` | Start asynchronous optimization or transcript/storyboard enrichment | | `videos.wait_for_optimization(id, ...)` / `wait_for_enrichment(id, ...)` | Bounded polling with backoff; returns video, terminal/current status and `timed_out` | -| `exports.start()` / `wait(job_id)` / `download(job_id)` | Owner-authenticated tar export of non-expired images, videos, available derivatives and `manifest.json` relationships | +| `audio.upload(file \| url=, ...)` | Host original MP3, PCM/float WAV, AAC M4A, or Opus/Vorbis OGG with privacy, TTL, metadata, organization, and retry safety | +| `audio.get(id)` / `list(...)` / `list_all(...)` / `delete(id)` | Audio discovery and lifecycle by stable `aud_` ID | +| `audio.update(id, metadata=, folder=, collection_id=)` / `sign_url(id, expires_in=)` | Replace organization fields or mint a fresh private original URL | +| `exports.start()` / `wait(job_id)` / `download(job_id)` | Owner-authenticated tar export of non-expired images, videos, audio originals, available derivatives and `manifest.json` relationships | | `usage.get()` | Plan, usage, limits and what is left this month (including generation credits) | | `keys.list()` / `keys.create(label=, environment=)` / `keys.revoke(id)` | Manage your API keys (secret keys only) | | `register(email)` | Create an account, returns a first key once | | `device_login_start(email)` + `device_login_complete(email, code)` | Passwordless key minting | +Audio originals have an approved global maximum of 25,000,000 bytes; this is not +a plan allowance. PixelVault validates actual container/codec bytes and preserves +the original without transcoding. Audio editing, conversion, streaming manifests, +and transcription are intentionally unsupported. Sync and asyncio clients expose +the same audio methods. + ## Errors and retries Every failure raises `PixelVaultError` with `.status` (0 for network errors), `.code` (for example @@ -97,8 +116,9 @@ except PixelVaultError as err: The client retries `429` (honoring `Retry-After` up to 30 seconds) and, for `GET`/`DELETE` only, `5xx` and network errors. Uploads, job creation and `images.generate` are not retried after a `5xx` or network error. -Use an `idempotency_key` for replay-safe video direct/import/resumable uploads. A wait timing out locally does -not cancel the server job. Tune with `max_retries` (default 2) and `timeout` (seconds, default 60). +Use an `idempotency_key` for replay-safe audio and video direct/import uploads (and video resumable uploads). +A wait timing out locally does not cancel the server job. Tune with `max_retries` (default 2) and `timeout` +(seconds, default 60). ## License diff --git a/pyproject.toml b/pyproject.toml index 2e4e958..4b0928e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "pixelvault" -version = "0.5.1" +version = "0.6.0" description = "Official Python SDK for PixelVault, agent-first media hosting" readme = "README.md" license = "MIT" diff --git a/scripts/check_spec_coverage.py b/scripts/check_spec_coverage.py index b70da4e..1c56ebb 100644 --- a/scripts/check_spec_coverage.py +++ b/scripts/check_spec_coverage.py @@ -14,6 +14,7 @@ "register_account", "device_login_start", "device_login_complete", "list_videos", "upload_video", "get_video", "delete_video", "update_video", "optimize_video", "enrich_video", "analyze_video", "generate_video_poster", "sign_video_url", + "upload_audio", "list_audio", "get_audio", "update_audio", "sign_audio_url", "delete_audio", "create_video_upload", "upload_video_part", "complete_video_upload", "abort_video_upload", "start_export", "get_export_job", "download_export", } diff --git a/src/pixelvault/_core.py b/src/pixelvault/_core.py index 6286fe6..f40dbaf 100644 --- a/src/pixelvault/_core.py +++ b/src/pixelvault/_core.py @@ -13,7 +13,7 @@ from .errors import PixelVaultError -__version__ = "0.5.1" +__version__ = "0.6.0" DEFAULT_BASE_URL = "https://api.pixelvault.dev" MAX_BACKOFF = 30.0 diff --git a/src/pixelvault/audio.py b/src/pixelvault/audio.py new file mode 100644 index 0000000..ffd5b43 --- /dev/null +++ b/src/pixelvault/audio.py @@ -0,0 +1,407 @@ +from __future__ import annotations + +import asyncio +import hashlib +import io +import json +import os +from contextlib import contextmanager +from pathlib import Path +from typing import Any, AsyncIterator, BinaryIO, Dict, Iterator, Optional, Tuple, cast +from urllib.parse import quote + +from ._core import FileInput, Request, drop_none +from .types import Audio, AudioPage, AudioSignedUrl + +_AUDIO_MAX_BYTES = 25_000_000 + + +_CONTENT_TYPES = { + ".mp3": "audio/mpeg", + ".wav": "audio/wav", + ".m4a": "audio/mp4", + ".ogg": "audio/ogg", +} +_CONTENT_TYPE_ALIASES = { + "audio/mpeg": "audio/mpeg", + "audio/mp3": "audio/mpeg", + "audio/wav": "audio/wav", + "audio/x-wav": "audio/wav", + "audio/mp4": "audio/mp4", + "audio/m4a": "audio/mp4", + "audio/x-m4a": "audio/mp4", + "audio/ogg": "audio/ogg", + "application/ogg": "audio/ogg", +} + + +def _seg(value: str) -> str: + return quote(value, safe="") + + +@contextmanager +def _source(file: FileInput, filename: Optional[str]) -> Iterator[Tuple[BinaryIO, int, str]]: + owned = False + if isinstance(file, (str, os.PathLike)): + path = Path(file) + stream: BinaryIO = path.open("rb") + owned = True + name = filename or path.name + elif isinstance(file, (bytes, bytearray)): + stream = io.BytesIO(file) + owned = True + name = filename or "audio.mp3" + else: + stream = file + name = filename or os.path.basename(getattr(file, "name", "") or "") or "audio.mp3" + + if not stream.seekable(): + if owned: + stream.close() + raise ValueError("audio uploads require a seekable file object") + + start = stream.tell() + stream.seek(0, os.SEEK_END) + size = stream.tell() - start + stream.seek(start) + try: + yield stream, size, name + finally: + if owned: + stream.close() + else: + stream.seek(start) + + +def _content_type(filename: str, supplied: Optional[str]) -> str: + if supplied is not None: + canonical = _CONTENT_TYPE_ALIASES.get(supplied.lower()) + if canonical is not None: + return canonical + raise ValueError("audio content_type must describe MP3, WAV, M4A, or OGG bytes") + inferred = _CONTENT_TYPES.get(Path(filename).suffix.lower()) + if inferred is None: + raise ValueError("audio filename must end in .mp3, .wav, .m4a, or .ogg") + return inferred + + +def _lifecycle( + visibility: Optional[str], + sign_expires_in: Optional[int], + expires_in: Optional[int], + folder: Optional[str], + collection_id: Optional[str], + metadata: Optional[Dict[str, Any]], +) -> Dict[str, Any]: + return drop_none( + { + "visibility": visibility, + "sign_expires_in": sign_expires_in, + "expires_in": expires_in, + "folder": folder, + "collection_id": collection_id, + "metadata": metadata, + } + ) + + +def _upload_request( + *, + file: Optional[FileInput] = None, + url: Optional[str] = None, + filename: Optional[str] = None, + content_type: Optional[str] = None, + visibility: Optional[str] = None, + sign_expires_in: Optional[int] = None, + expires_in: Optional[int] = None, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + idempotency_key: Optional[str] = None, + sha256: Optional[str] = None, +) -> Request: + if (file is None) == (url is None): + raise ValueError("pass exactly one of `file` or `url`") + + idempotency_headers = {"Idempotency-Key": idempotency_key} if idempotency_key else {} + lifecycle = _lifecycle( + visibility, sign_expires_in, expires_in, folder, collection_id, metadata + ) + if url is not None: + return Request( + "POST", + "/v1/audio", + json=drop_none({"url": url, "filename": filename, **lifecycle}), + headers=idempotency_headers, + ) + + assert file is not None + with _source(file, filename) as (stream, size, name): + mime_type = _content_type(name, content_type) + if size > _AUDIO_MAX_BYTES: + raise ValueError( + "audio originals are limited to the approved global maximum of " + f"{_AUDIO_MAX_BYTES:,} bytes; this is not a plan allowance" + ) + content = stream.read() + digest = sha256 or (hashlib.sha256(content).hexdigest() if idempotency_key else None) + headers = { + "Content-Type": mime_type, + "Content-Length": str(size), + "X-PixelVault-Filename": quote(name, safe=""), + **idempotency_headers, + } + if visibility is not None: + headers["X-PixelVault-Visibility"] = visibility + if sign_expires_in is not None: + headers["X-PixelVault-Sign-Expires-In"] = str(sign_expires_in) + if expires_in is not None: + headers["X-PixelVault-Expires-In"] = str(expires_in) + if folder is not None: + headers["X-PixelVault-Folder"] = folder + if collection_id is not None: + headers["X-PixelVault-Collection-Id"] = collection_id + if metadata is not None: + headers["X-PixelVault-Metadata"] = json.dumps(metadata, separators=(",", ":")) + if digest is not None: + headers["X-PixelVault-Content-SHA256"] = digest + return Request("POST", "/v1/audio", content=content, headers=headers) + + +def _page(body: Dict[str, Any], page: Optional[int], per_page: Optional[int]) -> AudioPage: + return cast( + AudioPage, + { + "data": body.get("data") or [], + "meta": body.get("meta") + or {"total": 0, "page": page or 1, "per_page": per_page or 0}, + }, + ) + + +def _has_more(result: AudioPage, page: int) -> bool: + per_page = result["meta"].get("per_page") or len(result["data"]) + return bool(result["data"]) and page * per_page < result["meta"].get("total", 0) + + +class AudioFiles: + def __init__(self, client: Any) -> None: + self._c = client + + def upload( + self, + file: Optional[FileInput] = None, + *, + url: Optional[str] = None, + filename: Optional[str] = None, + content_type: Optional[str] = None, + visibility: Optional[str] = None, + sign_expires_in: Optional[int] = None, + expires_in: Optional[int] = None, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + idempotency_key: Optional[str] = None, + sha256: Optional[str] = None, + ) -> Audio: + """Upload original audio bytes/path/file or securely import a public HTTP(S) URL.""" + request = _upload_request( + file=file, + url=url, + filename=filename, + content_type=content_type, + visibility=visibility, + sign_expires_in=sign_expires_in, + expires_in=expires_in, + folder=folder, + collection_id=collection_id, + metadata=metadata, + idempotency_key=idempotency_key, + sha256=sha256, + ) + return cast(Audio, self._c._send(request)["data"]) + + def list( + self, + page: Optional[int] = None, + per_page: Optional[int] = None, + *, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + ) -> AudioPage: + params = drop_none( + { + "page": page, + "per_page": per_page, + "folder": folder, + "collection_id": collection_id, + "metadata": json.dumps(metadata, separators=(",", ":")) if metadata else None, + } + ) + return _page(self._c._send(Request("GET", "/v1/audio", params=params)), page, per_page) + + def list_all( + self, + per_page: Optional[int] = None, + *, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + ) -> Iterator[Audio]: + page = 1 + while True: + result = self.list( + page, per_page, folder=folder, collection_id=collection_id, metadata=metadata + ) + yield from result["data"] + if not _has_more(result, page): + return + page += 1 + + def get(self, audio_id: str) -> Audio: + return cast(Audio, self._c._send(Request("GET", f"/v1/audio/{_seg(audio_id)}"))["data"]) + + def update( + self, + audio_id: str, + *, + metadata: Any = ..., + folder: Any = ..., + collection_id: Any = ..., + ) -> Audio: + body: Dict[str, Any] = {} + if metadata is not ...: + body["metadata"] = metadata + if folder is not ...: + body["folder"] = folder + if collection_id is not ...: + body["collection_id"] = collection_id + result = self._c._send(Request("PATCH", f"/v1/audio/{_seg(audio_id)}", json=body)) + return cast(Audio, result["data"]) + + def delete(self, audio_id: str) -> None: + self._c._send(Request("DELETE", f"/v1/audio/{_seg(audio_id)}")) + + def sign_url(self, audio_id: str, expires_in: Optional[int] = None) -> AudioSignedUrl: + request = Request( + "POST", + f"/v1/audio/{_seg(audio_id)}/sign-url", + json=drop_none({"expires_in": expires_in}), + ) + return cast(AudioSignedUrl, self._c._send(request)["data"]) + + +class AsyncAudioFiles: + def __init__(self, client: Any) -> None: + self._c = client + + async def upload( + self, + file: Optional[FileInput] = None, + *, + url: Optional[str] = None, + filename: Optional[str] = None, + content_type: Optional[str] = None, + visibility: Optional[str] = None, + sign_expires_in: Optional[int] = None, + expires_in: Optional[int] = None, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + idempotency_key: Optional[str] = None, + sha256: Optional[str] = None, + ) -> Audio: + request = await asyncio.to_thread( + _upload_request, + file=file, + url=url, + filename=filename, + content_type=content_type, + visibility=visibility, + sign_expires_in=sign_expires_in, + expires_in=expires_in, + folder=folder, + collection_id=collection_id, + metadata=metadata, + idempotency_key=idempotency_key, + sha256=sha256, + ) + return cast(Audio, (await self._c._send(request))["data"]) + + async def list( + self, + page: Optional[int] = None, + per_page: Optional[int] = None, + *, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + ) -> AudioPage: + params = drop_none( + { + "page": page, + "per_page": per_page, + "folder": folder, + "collection_id": collection_id, + "metadata": json.dumps(metadata, separators=(",", ":")) if metadata else None, + } + ) + body = await self._c._send(Request("GET", "/v1/audio", params=params)) + return _page(body, page, per_page) + + async def list_all( + self, + per_page: Optional[int] = None, + *, + folder: Optional[str] = None, + collection_id: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + ) -> AsyncIterator[Audio]: + page = 1 + while True: + result = await self.list( + page, per_page, folder=folder, collection_id=collection_id, metadata=metadata + ) + for audio in result["data"]: + yield audio + if not _has_more(result, page): + return + page += 1 + + async def get(self, audio_id: str) -> Audio: + result = await self._c._send(Request("GET", f"/v1/audio/{_seg(audio_id)}")) + return cast(Audio, result["data"]) + + async def update( + self, + audio_id: str, + *, + metadata: Any = ..., + folder: Any = ..., + collection_id: Any = ..., + ) -> Audio: + body: Dict[str, Any] = {} + if metadata is not ...: + body["metadata"] = metadata + if folder is not ...: + body["folder"] = folder + if collection_id is not ...: + body["collection_id"] = collection_id + result = await self._c._send( + Request("PATCH", f"/v1/audio/{_seg(audio_id)}", json=body) + ) + return cast(Audio, result["data"]) + + async def delete(self, audio_id: str) -> None: + await self._c._send(Request("DELETE", f"/v1/audio/{_seg(audio_id)}")) + + async def sign_url( + self, audio_id: str, expires_in: Optional[int] = None + ) -> AudioSignedUrl: + request = Request( + "POST", + f"/v1/audio/{_seg(audio_id)}/sign-url", + json=drop_none({"expires_in": expires_in}), + ) + return cast(AudioSignedUrl, (await self._c._send(request))["data"]) diff --git a/src/pixelvault/client.py b/src/pixelvault/client.py index 8323941..a1fb74f 100644 --- a/src/pixelvault/client.py +++ b/src/pixelvault/client.py @@ -20,6 +20,7 @@ ) from .errors import PixelVaultError from .videos import AsyncVideos, Videos +from .audio import AsyncAudioFiles, AudioFiles from .exports import AsyncExports, Exports from .types import ( ApiKey, @@ -88,6 +89,7 @@ def __init__( self.images = _Images(self) self.exports = Exports(self) self.videos = Videos(self) + self.audio = AudioFiles(self) self.usage = _Usage(self) self.keys = _Keys(self) @@ -324,6 +326,7 @@ def __init__( self.images = _AsyncImages(self) self.exports = AsyncExports(self) self.videos = AsyncVideos(self) + self.audio = AsyncAudioFiles(self) self.usage = _AsyncUsage(self) self.keys = _AsyncKeys(self) diff --git a/src/pixelvault/types.py b/src/pixelvault/types.py index 50ee6f4..bf01a0e 100644 --- a/src/pixelvault/types.py +++ b/src/pixelvault/types.py @@ -189,6 +189,41 @@ class VideoPage(TypedDict): meta: ListMeta +class Audio(TypedDict): + id: str + kind: Literal["audio"] + url: str + original_url: str + visibility: Literal["public", "private"] + mime_type: Literal["audio/mpeg", "audio/wav", "audio/mp4", "audio/ogg"] + size: int + container: Literal["mp3", "wav", "m4a", "ogg"] + codec: Literal["mp3", "pcm", "pcm_float", "aac", "opus", "vorbis"] + duration_seconds: float + sample_rate: int + channels: int + filename: str + folder: Optional[str] + collection_id: Optional[str] + metadata: Optional[Dict[str, Any]] + created_at: str + expires_at: NotRequired[str] + temporary: NotRequired[bool] + signed_expires: NotRequired[int] + replayed: NotRequired[bool] + + +class AudioPage(TypedDict): + data: List[Audio] + meta: ListMeta + + +class AudioSignedUrl(TypedDict): + url: str + expires: int + visibility: Literal["public", "private"] + + class VideoUploadSession(TypedDict): upload_id: str asset_id: str @@ -220,6 +255,7 @@ class ExportStart(TypedDict): status: str image_count: int video_count: int + audio_count: int asset_count: int status_url: str @@ -229,6 +265,7 @@ class ExportJob(TypedDict): status: str image_count: int video_count: int + audio_count: int asset_count: int processed_count: int bytes: int diff --git a/tests/test_client.py b/tests/test_client.py index 1fd2b35..0bd73d2 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -683,6 +683,147 @@ def handler(req): assert result["status"] == "failed" and result["timed_out"] is False +AUDIO = { + "id": "aud_1", + "kind": "audio", + "url": "https://img.pixelvault.dev/p/aud_1.mp3", + "original_url": "https://img.pixelvault.dev/p/aud_1.mp3", + "visibility": "public", + "mime_type": "audio/mpeg", + "size": 3, + "container": "mp3", + "codec": "mp3", + "duration_seconds": 1.25, + "sample_rate": 44_100, + "channels": 2, + "filename": "clip.mp3", + "folder": None, + "collection_id": None, + "metadata": None, + "created_at": "2026-11-16T00:00:00Z", +} + + +def test_audio_upload_sends_content_lifecycle_and_idempotency_headers(): + seen = {} + + def handler(req): + seen["request"] = req + return httpx.Response(201, json={"data": AUDIO}) + + audio = make(handler).audio.upload( + b"ogg", + filename="hello world.ogg", + visibility="private", + sign_expires_in=300, + expires_in=3600, + folder="episodes", + collection_id="col_1", + metadata={"season": 1}, + idempotency_key="audio-retry-1", + sha256="abc123", + ) + req = seen["request"] + assert audio["id"] == "aud_1" + assert req.content == b"ogg" + assert req.headers["content-type"] == "audio/ogg" + assert req.headers["x-pixelvault-filename"] == "hello%20world.ogg" + assert req.headers["x-pixelvault-visibility"] == "private" + assert req.headers["x-pixelvault-sign-expires-in"] == "300" + assert req.headers["x-pixelvault-expires-in"] == "3600" + assert req.headers["x-pixelvault-folder"] == "episodes" + assert req.headers["x-pixelvault-collection-id"] == "col_1" + assert json.loads(req.headers["x-pixelvault-metadata"]) == {"season": 1} + assert req.headers["idempotency-key"] == "audio-retry-1" + assert req.headers["x-pixelvault-content-sha256"] == "abc123" + + +def test_audio_import_lifecycle_filters_signing_and_delete(): + seen = [] + + def handler(req): + seen.append(req) + if req.method == "DELETE": + return httpx.Response(204) + if req.url.path == "/v1/audio" and req.method == "GET": + return httpx.Response( + 200, json={"data": [AUDIO], "meta": {"total": 1, "page": 1, "per_page": 20}} + ) + if req.url.path.endswith("/sign-url"): + return httpx.Response( + 200, + json={ + "data": { + "url": "https://signed.example/audio.mp3?sig=x", + "expires": 123, + "visibility": "private", + } + }, + ) + return httpx.Response(201 if req.method == "POST" else 200, json={"data": AUDIO}) + + pv = make(handler) + pv.audio.upload( + url="https://example.com/clip.mp3", + filename="clip.mp3", + metadata={"source": "demo"}, + idempotency_key="audio-import-1", + ) + pv.audio.get("aud/1") + page = pv.audio.list(folder="episodes", collection_id="col_1", metadata={"season": 1}) + pv.audio.update("aud_1", metadata=None, folder="archive", collection_id=None) + signed = pv.audio.sign_url("aud_1", 300) + pv.audio.delete("aud_1") + + assert json.loads(seen[0].content)["url"] == "https://example.com/clip.mp3" + assert seen[0].headers["idempotency-key"] == "audio-import-1" + assert seen[1].url.raw_path == b"/v1/audio/aud%2F1" + assert json.loads(seen[2].url.params["metadata"]) == {"season": 1} + assert json.loads(seen[3].content) == { + "metadata": None, + "folder": "archive", + "collection_id": None, + } + assert page["meta"]["total"] == 1 + assert signed["expires"] == 123 + + +@pytest.mark.asyncio +async def test_async_audio_upload_and_get(): + calls = [] + + def handler(req): + calls.append(req) + return httpx.Response(201 if req.method == "POST" else 200, json={"data": AUDIO}) + + async with amake(handler) as pv: + imported = await pv.audio.upload(url="https://example.com/clip.m4a") + fetched = await pv.audio.get("aud_1") + assert imported["id"] == fetched["id"] == "aud_1" + assert calls[0].url.path == "/v1/audio" + + +def test_audio_rejects_an_unknown_direct_format_before_network_io(): + def handler(_req): + raise AssertionError("network should not be called") + + with pytest.raises(ValueError, match="mp3, .wav, .m4a, or .ogg"): + make(handler).audio.upload(b"not audio", filename="clip.bin") + +def test_audio_rejects_a_direct_original_above_the_approved_ceiling(tmp_path): + path = tmp_path / "oversized.mp3" + with path.open("wb") as stream: + stream.seek(25_000_000) + stream.write(b"0") + + def handler(_req): + raise AssertionError("network should not be called") + + with pytest.raises(ValueError, match="25,000,000 bytes"): + make(handler).audio.upload(path) + + + def test_exports_start_wait_and_download_bytes(): seen = [] @@ -696,7 +837,8 @@ def handler(req): "status": "pending", "image_count": 2, "video_count": 1, - "asset_count": 3, + "audio_count": 1, + "asset_count": 4, "status_url": "/v1/export-jobs/exp_1", }, ) @@ -709,8 +851,9 @@ def handler(req): "status": "complete", "image_count": 2, "video_count": 1, - "asset_count": 3, - "processed_count": 3, + "audio_count": 1, + "asset_count": 4, + "processed_count": 4, "bytes": 4, "created_at": "2026-11-16T00:00:00Z", "expires_at": "2026-11-17T00:00:00Z", @@ -723,6 +866,7 @@ def handler(req): waited = pv.exports.wait(started["job_id"], project_id="proj_1", timeout=0) archive = pv.exports.download(started["job_id"], project_id="proj_1") assert started["video_count"] == 1 + assert started["audio_count"] == 1 assert waited["job"]["status"] == "complete" and waited["timed_out"] is False assert archive == b"tar!" assert all(req.url.params["project_id"] == "proj_1" for req in seen) @@ -740,6 +884,7 @@ def handler(req): "status": "pending", "image_count": 0, "video_count": 1, + "audio_count": 0, "asset_count": 1, "status_url": "/v1/export-jobs/exp_1", }, @@ -751,6 +896,7 @@ def handler(req): "status": "processing", "image_count": 0, "video_count": 1, + "audio_count": 0, "asset_count": 1, "processed_count": 0, "bytes": 0, diff --git a/uv.lock b/uv.lock index 8af37b8..0970bca 100644 --- a/uv.lock +++ b/uv.lock @@ -516,7 +516,7 @@ wheels = [ [[package]] name = "pixelvault" -version = "0.5.1" +version = "0.6.0" source = { editable = "." } dependencies = [ { name = "httpx" },