feat(*): refactor dynamic vs. static structure and distinctions; make additional elements dynamic
This commit is contained in:
parent
7a0b808f24
commit
eaab389cb9
136 changed files with 984 additions and 960 deletions
24
app/Classes/ArtistFetcher.php
Normal file
24
app/Classes/ArtistFetcher.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Classes;
|
||||
|
||||
class ArtistFetcher extends PageFetcher
|
||||
{
|
||||
public function fetch(string $url): ?array
|
||||
{
|
||||
$cacheKey = "artist_" . md5($url);
|
||||
$cached = $this->cacheGet($cacheKey);
|
||||
|
||||
if ($cached) return $cached;
|
||||
|
||||
$artist = $this->fetchSingleFromApi("optimized_artists", $url);
|
||||
|
||||
if (!$artist) return null;
|
||||
|
||||
$artist['globals'] = $this->getGlobals();
|
||||
|
||||
$this->cacheSet($cacheKey, $artist);
|
||||
|
||||
return $artist;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue