mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 02:21:55 -04:00
Make 'more ebooks' carousel in ebook detail page show ebooks from a random tag of the current ebook
This commit is contained in:
parent
2b32b5d4f9
commit
5985939cd5
2 changed files with 25 additions and 9 deletions
|
@ -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 [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue