feat: presents popular tv shows on landing page
This commit is contained in:
@@ -111,6 +111,23 @@ class Tmdb
|
||||
return $movies;
|
||||
}
|
||||
|
||||
public function popularTvShows(int $page = 1, ?int $limit = null)
|
||||
{
|
||||
$movies = $this->tvRepository->getPopular(['page' => $page]);
|
||||
|
||||
$movies = $movies->map(function ($movie) use ($movies) {
|
||||
return $this->parseResult($movies[$movie], "movie");
|
||||
});
|
||||
|
||||
$movies = array_values($movies->toArray());
|
||||
|
||||
if (null !== $limit) {
|
||||
$movies = array_slice($movies, 0, $limit);
|
||||
}
|
||||
|
||||
return $movies;
|
||||
}
|
||||
|
||||
public function search(string $term, int $page = 1)
|
||||
{
|
||||
$searchRepository = new SearchRepository($this->client);
|
||||
|
||||
Reference in New Issue
Block a user