Event Details Cache
Status: Reference
Last Updated: 2025-11-02
Related Docs: API Integration, EPG Generation Guide
Code Location: backend/epgoat/utilities/event_details_cache.py, backend/epgoat/scripts/fetch_event_details.py
This document describes the details cache used by the providers.
Cache File: dist/events_details_db.json
Structure
- Top-level
eventsmap:idEvent->{ details: <raw-api-json>, fetched_at: ISO8601, normalized: {...} } - Top-level
metamap:generated_at,version, etc.
Purpose
- Avoid repeated remote API calls for the same event
- Keep a freshness (TTL) so events can be re-fetched periodically
Usage
scripts/fetch_event_details.py- Manual CLI script to fetch and populate the cacheutilities/event_details_cache.py- Importable helpers forbackend/epgoat/cli/run_provider.py
Environment Variables
| Variable | Description | Example |
|---|---|---|
EVENT_API_BASE |
Base URL for your API | https://api.example.com/v2 |
EVENT_API_TOKEN |
Bearer token if needed | your-token-here |
EVENT_DETAILS_TTL_HOURS |
TTL in hours | 24 (default) |
Atomic Writes and File Locking
The helper uses an advisory file lock (.events_details.lock) and writes atomically via a temp file to prevent corruption.