Files
Claude 18783dc137 Fix errors unmasked by re-enabling error_reporting(E_ALL)
- config.example.php: error_reporting(0) -> E_ALL (live config.php matches); add JELLYFIN_URL/JELLYFIN_API_KEY placeholders

- history.php, jellyfin.php: drop require of nonexistent includes/auth.php + AuthMiddleware call (router enforces auth centrally) — both endpoints were fataling on every request

- remove stale kb_intent_generator .bak files from deployed tree

DB (not in repo): kb_facts.fact_value TEXT -> MEDIUMTEXT; ha/entity_map had failed every write since Jul 2 at >64KB

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 19:43:37 -05:00

20 lines
498 B
PHP

<?php
// Chat history search endpoint
require_once __DIR__ . '/../config.php';
header('Content-Type: application/json');
$q = trim($_GET['q'] ?? '');
if (strlen($q) < 2) {
echo json_encode(['results' => [], 'error' => 'Query too short']);
exit;
}
$rows = JarvisDB::query(
"SELECT role, content, created_at FROM conversations
WHERE content LIKE ? ORDER BY created_at DESC LIMIT 25",
['%' . $q . '%']
) ?? [];
echo json_encode(['results' => $rows, 'total' => count($rows)]);