feat(*): refactor metadata handling; move metadata to backend where possible, refine client views

This commit is contained in:
Cory Dransfeldt 2025-05-25 20:15:45 -07:00
parent 929bc9f9f8
commit 9687509e4a
No known key found for this signature in database
35 changed files with 506 additions and 339 deletions

View file

@ -1,22 +1,24 @@
<?php
namespace App\Classes;
namespace App\Classes;
class ArtistFetcher extends PageFetcher
{
public function fetch(string $url): ?array
class ArtistFetcher extends PageFetcher
{
$cacheKey = "artist_" . md5($url);
$cached = $this->cacheGet($cacheKey);
public function fetch(string $url): ?array
{
$cacheKey = "artist_" . md5($url);
$cached = $this->cacheGet($cacheKey);
if ($cached) return $cached;
if ($cached) return $cached;
$artist = $this->fetchSingleFromApi("optimized_artists", $url);
$artist = $this->fetchSingleFromApi("optimized_artists", $url);
if (!$artist) return null;
if (!$artist) return null;
$this->cacheSet($cacheKey, $artist);
$artist['globals'] = $this->getGlobals();
return $artist;
$this->cacheSet($cacheKey, $artist);
return $artist;
}
}
}