Fix: Error 500 on export. Fix: Show health page immediately then load the diag data.

This commit is contained in:
Johnnybegood90
2026-03-15 02:08:22 +01:00
parent dde85a4e38
commit 3f8aab5e70
4 changed files with 222 additions and 159 deletions
+6 -3
View File
@@ -123,10 +123,13 @@ $sources = array_values($config['epg_sources'] ?? []);
$source_index = max(0, min((int) ($_GET['source'] ?? 0), max(count($sources) - 1, 0)));
$source = $sources[$source_index] ?? null;
$target_day = preg_match('/^\d{4}-\d{2}-\d{2}$/', (string) ($_GET['day'] ?? '')) ? (string) $_GET['day'] : (new DateTimeImmutable('today'))->format('Y-m-d');
$layout = in_array((string) ($_GET['layout'] ?? 'cards'), ['cards', 'timeline'], true) ? (string) $_GET['layout'] : 'cards';
$limit = in_array((string) ($_GET['limit'] ?? '8'), ['4', '8', 'all'], true) ? (string) $_GET['limit'] : '8';
$layout_input = isset($_GET['layout']) ? (string) $_GET['layout'] : 'cards';
$limit_input = isset($_GET['limit']) ? (string) $_GET['limit'] : '8';
$window_input = isset($_GET['window']) ? (string) $_GET['window'] : 'full';
$layout = in_array($layout_input, ['cards', 'timeline'], true) ? $layout_input : 'cards';
$limit = in_array($limit_input, ['4', '8', 'all'], true) ? $limit_input : '8';
$windows = export_window_definitions($target_day);
$window_key = array_key_exists((string) ($_GET['window'] ?? 'full'), $windows) ? (string) $_GET['window'] : 'full';
$window_key = array_key_exists($window_input, $windows) ? $window_input : 'full';
$window = $windows[$window_key];
$slots = export_hour_slots($window['start'], $window['end']->modify('+1 second'));