Adjusting comments into files.

This commit is contained in:
Johnnybegood90
2026-03-14 04:23:44 +01:00
parent 062954a780
commit 8dabd2d190
19 changed files with 69 additions and 73 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
$config_path = __DIR__ . '/config.json';
// Migration automatique ancien format
// Automatically migrate the legacy config format.
if (file_exists($config_path)) {
$existing = json_decode(file_get_contents($config_path), true);
if (isset($existing['epg_url']) && !isset($existing['epg_sources'])) {
@@ -14,7 +14,7 @@ if (file_exists($config_path)) {
unset($existing['epg_url'], $existing['m3u_url']);
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
}
// Bootstrap : config existante sans cle admin -> on en genere une maintenant
// Bootstrap an admin key for older configs that do not have one yet.
if (empty($existing['admin_key'])) {
$existing['admin_key'] = bin2hex(random_bytes(16));
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));