Make 'more ebooks' carousel in ebook detail page show ebooks from a random tag of the current ebook

This commit is contained in:
Alex Cabal 2022-04-30 13:19:02 -05:00
parent 2b32b5d4f9
commit 5985939cd5
2 changed files with 25 additions and 9 deletions

View file

@ -116,7 +116,12 @@ class Library{
* @return array<Ebook>
*/
public static function GetEbooksByTag(string $tag): array{
return self::GetFromApcu('tag-' . $tag);
try{
return apcu_fetch('tag-' . $tag) ?? [];
}
catch(Safe\Exceptions\ApcuException $ex){
return [];
}
}
/**