<?php
require_once __DIR__ . '/../includes/stream_lib.php';

header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');

$title = trim((string)smurf_get_nowplaying_title());
if ($title === '') {
    $title = 'DJ Eagle is warming up the jukebox…';
}

echo json_encode(['title' => $title], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
