28 lines
539 B
PHP
28 lines
539 B
PHP
<?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;
|
|
}
|
|
}
|