feat(reading): clean and refactor routing for books -> reading to separate paths

This commit is contained in:
Cory Dransfeldt 2025-05-16 13:03:55 -07:00
parent 8d9455940e
commit 2666d6ed67
No known key found for this signature in database
21 changed files with 51 additions and 89 deletions

View file

@ -9,18 +9,12 @@
$requestUri = $_SERVER["REQUEST_URI"];
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
if (!preg_match('/^music\/genres\/[\w-]+$/', $url)) {
echo file_get_contents(__DIR__ . "/../../404/index.html");
exit();
}
if (!preg_match('/^music\/genres\/[\w-]+$/', $url)) redirectTo404();
$fetcher = new GenreFetcher();
$genre = $fetcher->fetch($url);
if (!$genre) {
echo file_get_contents(__DIR__ . "/../../404/index.html");
exit();
}
if (!$genre) redirectTo404();
$pageTitle = htmlspecialchars("Genres • " . $genre["name"], ENT_QUOTES, "UTF-8");
$pageDescription = truncateText(