Event Details Cache

EPGOAT Documentation - AI Reference (Educational)

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 events map: idEvent -> { details: <raw-api-json>, fetched_at: ISO8601, normalized: {...} }
  • Top-level meta map: 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 cache
  • utilities/event_details_cache.py - Importable helpers for backend/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.