From 34e0b408f8a6413aa23e52d2945a34590b8b8f32 Mon Sep 17 00:00:00 2001 From: Johnnybegood90 Date: Wed, 11 Mar 2026 19:31:41 +0100 Subject: [PATCH] feat: multi-EPG support + auto-migration old config format - setup.php: dynamic EPG source fields (+ Add source button) - setup.php: toggle to allow personal EPG for visitors - index.php: auto-migrates old epg_url/m3u_url to epg_sources[] on first load - index.php: EPG_SOURCES array injected from PHP into JS - Backward compatible: single-source instances migrate silently --- index.php | 43 ++++-- setup.php | 395 +++++++++++++++++++++++++++++++++--------------------- 2 files changed, 277 insertions(+), 161 deletions(-) diff --git a/index.php b/index.php index 3342197..a962074 100644 --- a/index.php +++ b/index.php @@ -1,14 +1,35 @@ 'Main', + 'epg_url' => $config['epg_url'], + 'm3u_url' => $config['m3u_url'] ?? '', + ]]; + $config['allow_personal_epg'] = false; + unset($config['epg_url'], $config['m3u_url']); + file_put_contents($config_path, json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); +} +// ───────────────────────────────────────────────────────────────────────────── + +$group_name = htmlspecialchars($config['group_name'] ?? 'GridTV'); +$epg_sources = $config['epg_sources'] ?? []; +$allow_personal_epg = !empty($config['allow_personal_epg']); + +// Première source par défaut (pour compatibilité avec le reste du code) +$first_source = $epg_sources[0] ?? []; +$epg_url = htmlspecialchars($first_source['epg_url'] ?? ''); +$m3u_url = htmlspecialchars($first_source['m3u_url'] ?? ''); ?> @@ -809,8 +830,14 @@ foreach ($theme_files as $file) {