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 MovieFetcher extends PageFetcher
{
public function fetch(string $url): ?array
class MovieFetcher extends PageFetcher
{
$cacheKey = "movie_" . md5($url);
$cached = $this->cacheGet($cacheKey);
public function fetch(string $url): ?array
{
$cacheKey = "movie_" . md5($url);
$cached = $this->cacheGet($cacheKey);
if ($cached) return $cached;
if ($cached) return $cached;
$movie = $this->fetchSingleFromApi("optimized_movies", $url);
$movie = $this->fetchSingleFromApi("optimized_movies", $url);
if (!$movie) return null;
if (!$movie) return null;
$this->cacheSet($cacheKey, $movie);
$movie['globals'] = $this->getGlobals();
return $movie;
$this->cacheSet($cacheKey, $movie);
return $movie;
}
}
}