Stuff i guess ?

This commit is contained in:
Lars Behrends
2025-10-31 00:24:17 +01:00
parent db0fd4e728
commit 04140786a7
40 changed files with 5411 additions and 525 deletions

View File

@@ -33,32 +33,27 @@ class SearchController extends Controller
$results = [];
// Search movies (including adult videos)
$movieStmt = $this->pdo->prepare("
$searchTerm = $this->pdo->quote("%$search%");
$movieStmt = $this->pdo->query("
SELECT m.*, s.display_name as source_name, 'movie' as type
FROM movies m
JOIN sources s ON m.source_id = s.id
WHERE (m.title LIKE :search OR m.overview LIKE :search)
WHERE (m.title LIKE $searchTerm OR m.overview LIKE $searchTerm)
ORDER BY m.title
LIMIT 20
");
$searchParam = "%{$search}%";
$movieStmt->bindParam(':search', $searchParam, \PDO::PARAM_STR);
$movieStmt->execute();
$results['movies'] = $movieStmt->fetchAll(\PDO::FETCH_ASSOC);
// Search games
$gameStmt = $this->pdo->prepare("
SELECT g.*, s.display_name as source_name, 'game' as type
$gameStmt = $this->pdo->query("
SELECT g.*, 'game' as type
FROM games g
JOIN sources s ON g.source_id = s.id
WHERE (g.name LIKE :search OR g.description LIKE :search)
ORDER BY g.name
WHERE (g.title LIKE $searchTerm OR g.description LIKE $searchTerm)
ORDER BY g.title
LIMIT 20
");
$gameStmt->bindParam(':search', $searchParam, \PDO::PARAM_STR);
$gameStmt->execute();
$results['games'] = $gameStmt->fetchAll(\PDO::FETCH_ASSOC);
return $this->view->render($response, 'search/index.twig', [
'title' => 'Search Results',
'search' => $search,