mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
Channel-list rendering called EpgService.getCurrentProgramsForChannels(), which forkJoined N getChannelPrograms() Observables — each firing its own IPC round-trip and its own SQL query. For a 500-channel visible window on first scroll, that was 500 IPC calls and 500 SELECTs hammering the EPG table. Add GET_CURRENT_PROGRAMS_BATCH IPC handler that takes the channel-id array and runs a single SELECT with WHERE channel_id IN (...) AND start <= now AND stop >= now. The renderer-side cache and TTL behavior are preserved; only the network of IPC calls collapses to one. A fallback path keeps the old per-channel behavior if the preload lacks the new endpoint. Per-channel display-name fallback (NOCASE id, then NOCASE display name) is preserved from handleGetChannelPrograms so behavior matches the existing single-channel handler. Inspired by matracey/iptvnator@d25a7e8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 6719280e397b