From b3a173aa91e831936b9680fceb69edeaab5f20b4 Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Wed, 12 Jun 2024 23:26:35 -0600 Subject: [PATCH] Get ebooks in a collection from DB --- lib/Library.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Library.php b/lib/Library.php index 2902b24f..235a03f2 100644 --- a/lib/Library.php +++ b/lib/Library.php @@ -159,12 +159,16 @@ class Library{ /** * @return array - * @throws Exceptions\AppException */ public static function GetEbooksByCollection(string $collection): array{ - // Do we have the tag's ebooks cached? - /** @var array */ - return self::GetFromApcu('collection-' . $collection); + $ebooks = Db::Query(' + SELECT e.* + from Ebooks e inner join Collections c using (EbookId) + where c.UrlName = ? + order by c.SequenceNumber, e.Title + ', [$collection], Ebook::class); + + return $ebooks; } /**