Add Bingearr integration API + promo-preroll ingest (/api/integration/*)#32
Open
JFLXCLOUD wants to merge 2 commits into
Open
Add Bingearr integration API + promo-preroll ingest (/api/integration/*)#32JFLXCLOUD wants to merge 2 commits into
JFLXCLOUD wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the stable public surface that Bingearr (sibling project) calls to attach and auto-generate prerolls for marathons.
Endpoints (auth:
X-Api-Keyvia existingrequire_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 attl(default 480 min) override so the scheduler doesn't revert mid-marathonPOST /api/integration/clear→ clears the override and callsscheduler.trigger_immediate_check()to restore the normal schedulePOST /api/integration/preroll(multipart) → ingest a Bingearr-generated promo into a lockedBingearrsystem 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
PREROLLS_DIR, ffprobe, and theapi_keysstore.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/prerollsshapes;applyrouting + 400/404 validation;clearreverts; and Bingearr generated a promo from real playlist art that landed in the lockedBingearrcategory with a single-preroll sequence. Actual Plex writes delegate to NeXroll's own production functions.🤖 Generated with Claude Code