mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
Introduce a lowercase display name index (Map) to allow O(1) resolution from display name to channel id. Rebuild the index during merged-data rebuild and use it in channel lookups to avoid expensive full scans. Add a fallback partial-match pass only when the index lookup fails. Add automatic and manual cleanup of expired programs: - Add cleanupExpiredPrograms(hoursToKeep) to remove programs older than the specified number of hours from epgDataMerged. - Invoke cleanup after worker fetches (auto-cleanup with 24 hours). - Expose an IPC handler EPG_CLEANUP_EXPIRED to trigger cleanup on demand. Other changes: - Clear epgData.programs after merging to free memory. - Log merged data rebuild and cleanup counts for observability. These changes improve performance of channel resolution, reduce memory usage by pruning stale program entries, and provide a manual hook for on-demand maintenance.