Skip to content

Add Bingearr integration API + promo-preroll ingest (/api/integration/*)#32

Open
JFLXCLOUD wants to merge 2 commits into
mainfrom
feat/bingearr-integration-api
Open

Add Bingearr integration API + promo-preroll ingest (/api/integration/*)#32
JFLXCLOUD wants to merge 2 commits into
mainfrom
feat/bingearr-integration-api

Conversation

@JFLXCLOUD

@JFLXCLOUD JFLXCLOUD commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Implements the stable public surface that Bingearr (sibling project) calls to attach and auto-generate prerolls for marathons.

Endpoints (auth: X-Api-Key via existing require_api_key)

  • GET /api/integration/status{ ok, version, server_connected }
  • GET /api/integration/prerolls → categories + saved sequences as [{ id, name, type }]
  • POST /api/integration/apply{ ref: "<type>:<id>", server }; applies a category (_apply_category_to_plex_and_track) or sequence (apply_sequence_to_server), with a ttl (default 480 min) override so the scheduler doesn't revert mid-marathon
  • POST /api/integration/clear → clears the override and calls scheduler.trigger_immediate_check() to restore the normal schedule
  • POST /api/integration/preroll (multipart) → ingest a Bingearr-generated promo into a locked Bingearr system category (is_system=True, read-only in the UI) and (re)create a one-preroll sequence so it can be applied precisely. Returns { preroll_id, category, sequence_id, ref }.

Notes

  • No new dependencies. Reuses existing apply paths, PREROLLS_DIR, ffprobe, and the api_keys store.
  • Bingearr side + the full contract: Bingearr repo docs/nexroll-integration.md.

Verification

Ran against a live instance with an isolated DB + prerolls dir (NEXROLL_DB_PATH / NEXROLL_PREROLL_PATH): 401 without key; status/prerolls shapes; apply routing + 400/404 validation; clear reverts; and Bingearr generated a promo from real playlist art that landed in the locked Bingearr category with a single-preroll sequence. Actual Plex writes delegate to NeXroll's own production functions.

🤖 Generated with Claude Code

JB and others added 2 commits June 30, 2026 13:21
Add a small, stable public surface for Bingearr (sibling project) to discover
prerolls and apply/clear them when a marathon is activated:

- GET  /api/integration/status   -> { ok, version, server_connected }
- GET  /api/integration/prerolls -> categories + saved sequences as
                                    [{ id, name, type }]
- POST /api/integration/apply    -> { ref:"<type>:<id>", server } applies a
                                    category (via _apply_category_to_plex_and_track)
                                    or a saved sequence (via apply_sequence_to_server),
                                    holding off the scheduler for `ttl` minutes
- POST /api/integration/clear    -> drops the override and re-runs the scheduler
                                    (trigger_immediate_check) to restore the
                                    normal schedule

Auth reuses the existing api_keys store via Depends(require_api_key) (X-Api-Key).
No new dependencies; delegates to existing apply paths.

Verified against a live instance (isolated DB): auth 401, status/prerolls,
apply routing + 400/404 validation, and clear.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Accepts a multipart upload from Bingearr and stores it in a locked "Bingearr"
system category (is_system=True, read-only in the UI), replacing any prior file
for the same marathon. Also (re)creates a one-preroll SavedSequence so the
promo can be applied precisely via /api/integration/apply (ref "sequence:<id>").

Reuses PREROLLS_DIR, ffprobe duration probe, and the existing category/sequence
models; no new dependencies.

Verified against a live instance (isolated DB + prerolls dir): promo landed in
the locked Bingearr category, single-preroll sequence created, file written to
the configured prerolls folder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JFLXCLOUD JFLXCLOUD changed the title Add Bingearr integration API (/api/integration/*) Add Bingearr integration API + promo-preroll ingest (/api/integration/*) Jul 1, 2026
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.

1 participant