feat(*.php): refactor, clean up and abstract dynamic page code

This commit is contained in:
Cory Dransfeldt 2025-05-14 17:22:35 -07:00
parent 2f9038dccb
commit 60be0ed01d
No known key found for this signature in database
30 changed files with 318 additions and 401 deletions

View file

@ -0,0 +1,19 @@
<?php
namespace App\Classes;
class GenreFetcher extends PageFetcher
{
public function fetch(string $url): ?array
{
$cacheKey = "genre_" . md5($url);
$cached = $this->cacheGet($cacheKey);
if ($cached) return $cached;
$genre = $this->fetchSingleFromApi("optimized_genres", $url);
if (!$genre) return null;
$this->cacheSet($cacheKey, $genre);
return $genre;
}
}