This commit is contained in:
@@ -40,7 +40,11 @@ Series are matched by folder name (e.g. `series/W817` → search "W817"); episod
|
|||||||
- **Persistent cache:** Fetched metadata is stored under `/data/tmdb_cache/` (series search, series details, episode, episode credits). When generating the EPG, the app checks this cache first and only calls TMDB for missing entries. Mount `/data` read-write (omit `:ro`) so the cache can be written.
|
- **Persistent cache:** Fetched metadata is stored under `/data/tmdb_cache/` (series search, series details, episode, episode credits). When generating the EPG, the app checks this cache first and only calls TMDB for missing entries. Mount `/data` read-write (omit `:ro`) so the cache can be written.
|
||||||
- **Rate limit:** TMDB allows 40 requests per 10 seconds. The app enforces this limit when calling the API; if the cache is warm, few or no requests are made during EPG generation.
|
- **Rate limit:** TMDB allows 40 requests per 10 seconds. The app enforces this limit when calling the API; if the cache is warm, few or no requests are made during EPG generation.
|
||||||
|
|
||||||
**Logging:** Set `LOG_LEVEL=DEBUG` (e.g. in your `docker run` with `-e LOG_LEVEL=DEBUG`) to see where time is spent: schedule building (including ffprobe per video), EPG per-channel programme count and duration, and TMDB cache hits (memory/disk) vs API requests and rate-limit waits.
|
**Logging:** Set `LOG_LEVEL=DEBUG` (e.g. in your `docker run` with `-e LOG_LEVEL=DEBUG`) to see where time is spent: schedule building (including ffprobe per video), EPG per-channel programme count and duration, TMDB cache hits (memory/disk) vs API requests and rate-limit waits, and EPG cache hit/miss reasons.
|
||||||
|
|
||||||
|
**Cache locations** (under `/data`):
|
||||||
|
- EPG: `/data/cache/epg.xml` — XMLTV guide; valid only while `channels.json` is unchanged.
|
||||||
|
- Schedule: `/data/cache/schedule_<channel>.json` — per-channel video schedules.
|
||||||
|
|
||||||
**Stream crashes when switching episodes?** If the live stream freezes or crashes when transitioning between videos (e.g. different episodes with different resolutions), enable normalization to re-encode everything to a uniform format:
|
**Stream crashes when switching episodes?** If the live stream freezes or crashes when transitioning between videos (e.g. different episodes with different resolutions), enable normalization to re-encode everything to a uniform format:
|
||||||
- `NORMALIZE_LIVE_STREAM=1` — enables re-encoding (uses more CPU, produces a stable continuous stream)
|
- `NORMALIZE_LIVE_STREAM=1` — enables re-encoding (uses more CPU, produces a stable continuous stream)
|
||||||
|
|||||||
@@ -120,12 +120,18 @@ class CacheManager:
|
|||||||
self.invalidate_if_needed()
|
self.invalidate_if_needed()
|
||||||
current = get_channels_hash(self._channels_file)
|
current = get_channels_hash(self._channels_file)
|
||||||
if current is None:
|
if current is None:
|
||||||
|
logger.debug("EPG cache miss: channels.json not found or unreadable")
|
||||||
return None
|
return None
|
||||||
epg_path = self._epg_cache_file()
|
epg_path = self._epg_cache_file()
|
||||||
if not epg_path.exists():
|
if not epg_path.exists():
|
||||||
|
logger.debug("EPG cache miss: %s does not exist", epg_path)
|
||||||
return None
|
return None
|
||||||
stored = self._get_stored_hash()
|
stored = self._get_stored_hash()
|
||||||
|
if stored is None:
|
||||||
|
logger.debug("EPG cache miss: %s does not exist (hash required)", self._hash_file())
|
||||||
|
return None
|
||||||
if stored != current:
|
if stored != current:
|
||||||
|
logger.debug("EPG cache miss: channels.json changed (hash %s -> %s)", stored[:16], current[:16])
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
return epg_path.read_text(encoding="utf-8")
|
return epg_path.read_text(encoding="utf-8")
|
||||||
|
|||||||
Reference in New Issue
Block a user