Files
GridTV/src/js/config.js
T
Johnnybegood90 9b068e7c74 Add program reminders and category filtering to the guide UI
Enhance health diagnostics with EPG quality and source metrics
2026-03-17 03:10:21 +01:00

25 lines
1.0 KiB
JavaScript

const EPG_SOURCES = <?= json_encode(array_values($epg_sources)) ?>;
const L = <?= json_encode($L) ?>;
const ALLOW_PERSONAL_EPG = <?= $allow_personal_epg ? 'true' : 'false' ?>;
const ALLOW_PERSONAL_M3U = <?= $allow_personal_m3u ? 'true' : 'false' ?>;
// Index of the currently selected source.
let activeSourceIndex = 0;
const DEFAULT_EPG_URL = EPG_SOURCES[0]?.epg_url ?? '';
const DEFAULT_M3U_URL = EPG_SOURCES[0]?.m3u_url ?? '';
const PX_PER_MIN = 5;
const GRID_HOURS = 72;
const CORS_PROXY = '/proxy.php?url=';
const REMINDER_STORAGE_KEY = 'gridtv-reminders';
const REMINDER_OFFSET_MS = 15 * 60 * 1000;
// Anchor the grid 2 hours before "now", rounded down to the previous quarter-hour.
const _d = new Date();
_d.setMinutes(Math.floor(_d.getMinutes()/15)*15, 0, 0);
const GRID_START = new Date(_d.getTime() - 2*3600000);
const GRID_END = new Date(GRID_START.getTime() + GRID_HOURS*3600000);
const TOTAL_WIDTH_PX = GRID_HOURS * 60 * PX_PER_MIN;
function msToX(ms) { return (ms - GRID_START.getTime()) / 60000 * PX_PER_MIN; }