Refactor functions out of Library

This commit is contained in:
Alex Cabal 2024-11-10 22:59:57 -06:00
parent 1449148989
commit b7b63a4be5
24 changed files with 419 additions and 444 deletions

View file

@ -12,7 +12,7 @@ try{
throw new Exceptions\AuthorNotFoundException();
}
$ebooks = Library::GetEbooksByAuthor($urlPath);
$ebooks = Ebook::GetAllByAuthor($urlPath);
if(sizeof($ebooks) == 0){
throw new Exceptions\AuthorNotFoundException();

View file

@ -68,7 +68,7 @@ try{
if(sizeof($ebook->Tags) > 0){
$carouselTag = $ebook->Tags[rand(0, sizeof($ebook->Tags) - 1)];
}
$carousel = Library::GetRelatedEbooks($ebook, $targetCarouselSize, $carouselTag);
$carousel = Ebook::GetAllByRelated($ebook, $targetCarouselSize, $carouselTag);
}
catch(Exceptions\SeeOtherEbookException $ex){
http_response_code(301);

View file

@ -35,7 +35,7 @@ try{
$tags = [];
}
$result = Library::FilterEbooks($query != '' ? $query : null, $tags, $sort, $page, $perPage);
$result = Ebook::GetAllByFilter($query != '' ? $query : null, $tags, $sort, $page, $perPage);
$ebooks = $result['ebooks'];
$totalEbooks = $result['ebooksCount'];
$pageTitle = 'Browse Standard Ebooks';