Skip to content

feat(media): wire pending and failed ingest states - #115

Merged
tulayha merged 5 commits into
grayhatdevelopers:mainfrom
FaiziNerd:feat/media-pending-failed-states
Aug 13, 2026
Merged

feat(media): wire pending and failed ingest states#115
tulayha merged 5 commits into
grayhatdevelopers:mainfrom
FaiziNerd:feat/media-pending-failed-states

Conversation

@FaiziNerd

@FaiziNerd FaiziNerd commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Related to Show media state in the CLI media list #82
  • Import now catalogs media as pending, then ready after a successful probe, or failed if probe/import fails.
  • vidxp media list (and JSON/API/MCP) can distinguish those states. Indexing and managed-file access stay ready-only.
  • This is the follow-up requested on feat(cli): show media state in list command #82 #112: the CLI State column exists, but MediaState only had ready.
  • Public-facing contract: pending/failed items may omit duration/streams. Existing ready records are unchanged.
  • Transfer-level upload failures (tus expired, cancelled, never imported) stay on UploadState and are not added to the media catalog.
  • No new dependencies, environment variables, downloads, or SQL migrations.

Validation

  • Focused tests (mocked catalog/store/probe, not end-to-end FFmpeg):
    py -m uv run --no-sync pytest -q tests/test_media_services.py tests/test_media_catalog.py tests/test_cli.py -k "media_list or import_probes or invalid_probe or failed_checksum or get_returns or require_record or replaces_pending or ready_media_requires or quarantined_import or catalog_failure or existing_checksum"
    • Passed.
  • Broader related suite:
    py -m uv run --no-sync pytest -q tests/test_media_services.py tests/test_media_catalog.py tests/test_cli.py tests/test_api.py tests/test_control_plane.py tests/test_public_path_contracts.py
    • 120 passed, 3 skipped.

Comment thread src/vidxp/media_service.py Outdated
Comment thread src/vidxp/media_service.py
Comment thread src/vidxp/frontend.py Outdated
Comment thread src/vidxp/cli_commands/index.py Outdated
@FaiziNerd
FaiziNerd force-pushed the feat/media-pending-failed-states branch from 87a0d39 to 3e38960 Compare August 12, 2026 10:49
@FaiziNerd

Copy link
Copy Markdown
Contributor Author

Review follow-up

Thanks for the review. The latest commit addresses the open feedback:

Import failures: Probe failures were already marked failed. Publish and final catalog write failures are now marked failed as well, so unsuccessful imports do not stay stuck in pending. Existing managed-content cleanup on catalog failure is unchanged.
Index preflight: preflight_index() now uses require_record() instead of get_media(), so pending and failed media cannot be queued for indexing.
Streamlit UI: The “Registered video” selector lists only ready media. Stale pending/failed selections are ignored.
Index CLI table: Active snapshot media is ready-only, so duration formatting is back to {duration:.3f}s. media list still shows - for pending/failed rows.
Validation

py -m uv run --no-sync pytest -q tests/test_media_services.py tests/test_control_plane.py tests/test_frontend.py -k "preflight or publish_failure or registered"

Happy to adjust if anything else should change.

@tulayha
tulayha merged commit aa1f61e into grayhatdevelopers:main Aug 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants