MediaRole auto-detection during library sync #7

Closed
opened 2026-07-12 05:48:10 +00:00 by GKaszewski · 0 comments
Owner

Parent

#2

What to build

During library sync, automatically classify MediaItems as Program or Interstitial based on conventions the Operator configures. The MediaRole field already exists on MediaItem (defaults to Program).

Detection rules (configurable via app_settings or env):

  • Items from collections/directories matching a pattern (e.g., "Bumpers", "Ads", "Interstitials") get role: Interstitial
  • Items with specific tags (e.g., "bumper", "interstitial", "ad") get role: Interstitial
  • Items shorter than a configurable threshold (e.g., 60 seconds) in designated collections get role: Interstitial
  • Everything else defaults to role: Program

The Operator should also be able to manually override an item's role via the API.

Acceptance criteria

  • Library sync sets MediaRole based on collection name matching (configurable patterns)
  • Library sync sets MediaRole based on tag matching
  • Default role is Program when no rules match
  • API endpoint to manually set a MediaItem's role
  • Test: item from "Bumpers" collection gets Interstitial role
  • Test: item with "bumper" tag gets Interstitial role
  • Test: normal item from "Movies" collection gets Program role

Blocked by

None — can start immediately

## Parent #2 ## What to build During library sync, automatically classify MediaItems as Program or Interstitial based on conventions the Operator configures. The MediaRole field already exists on MediaItem (defaults to Program). Detection rules (configurable via app_settings or env): - Items from collections/directories matching a pattern (e.g., "Bumpers", "Ads", "Interstitials") get `role: Interstitial` - Items with specific tags (e.g., "bumper", "interstitial", "ad") get `role: Interstitial` - Items shorter than a configurable threshold (e.g., 60 seconds) in designated collections get `role: Interstitial` - Everything else defaults to `role: Program` The Operator should also be able to manually override an item's role via the API. ## Acceptance criteria - [ ] Library sync sets MediaRole based on collection name matching (configurable patterns) - [ ] Library sync sets MediaRole based on tag matching - [ ] Default role is Program when no rules match - [ ] API endpoint to manually set a MediaItem's role - [ ] Test: item from "Bumpers" collection gets Interstitial role - [ ] Test: item with "bumper" tag gets Interstitial role - [ ] Test: normal item from "Movies" collection gets Program role ## Blocked by None — can start immediately
GKaszewski added the ready-for-agent label 2026-07-12 05:48:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GKaszewski/k-tv#7