feat(*): refactor metadata handling; move metadata to backend where possible, refine client views
This commit is contained in:
parent
929bc9f9f8
commit
9687509e4a
35 changed files with 506 additions and 339 deletions
|
@ -1,22 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Classes;
|
||||
namespace App\Classes;
|
||||
|
||||
class BookFetcher extends PageFetcher
|
||||
{
|
||||
public function fetch(string $url): ?array
|
||||
class BookFetcher extends PageFetcher
|
||||
{
|
||||
$cacheKey = "book_" . md5($url);
|
||||
$cached = $this->cacheGet($cacheKey);
|
||||
public function fetch(string $url): ?array
|
||||
{
|
||||
$cacheKey = "book_" . md5($url);
|
||||
$cached = $this->cacheGet($cacheKey);
|
||||
|
||||
if ($cached) return $cached;
|
||||
if ($cached) return $cached;
|
||||
|
||||
$book = $this->fetchSingleFromApi("optimized_books", $url);
|
||||
$book = $this->fetchSingleFromApi("optimized_books", $url);
|
||||
|
||||
if (!$book) return null;
|
||||
if (!$book) return null;
|
||||
|
||||
$this->cacheSet($cacheKey, $book);
|
||||
$book['globals'] = $this->getGlobals();
|
||||
|
||||
return $book;
|
||||
$this->cacheSet($cacheKey, $book);
|
||||
|
||||
return $book;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue