feat(*): refactor dynamic vs. static structure and distinctions; make additional elements dynamic
This commit is contained in:
parent
7a0b808f24
commit
4d76a3ba1e
138 changed files with 998 additions and 970 deletions
24
app/Classes/GenreFetcher.php
Normal file
24
app/Classes/GenreFetcher.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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;
|
||||
|
||||
$genre['globals'] = $this->getGlobals();
|
||||
|
||||
$this->cacheSet($cacheKey, $genre);
|
||||
|
||||
return $genre;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue