mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
actors the i dont know xD
This commit is contained in:
@@ -41,11 +41,23 @@ class TvShowController extends Controller
|
||||
}
|
||||
$years = array_filter($years);
|
||||
|
||||
// Get view mode
|
||||
// Get view mode and sort
|
||||
$viewMode = $queryParams['view'] ?? 'grid'; // grid, list, covers
|
||||
$sort = $queryParams['sort'] ?? 'title_asc';
|
||||
|
||||
// Get TV shows with pagination and filters
|
||||
$tvshows = TvShow::getAllWithPagination($this->pdo, $page, $perPage, $search, $genres, $years);
|
||||
// Validate view mode
|
||||
if (!in_array($viewMode, ['grid', 'list', 'covers'])) {
|
||||
$viewMode = 'grid';
|
||||
}
|
||||
|
||||
// Validate sort option
|
||||
$validSorts = ['title_asc', 'title_desc', 'year_asc', 'year_desc', 'rating_asc', 'rating_desc'];
|
||||
if (!in_array($sort, $validSorts)) {
|
||||
$sort = 'title_asc';
|
||||
}
|
||||
|
||||
// Get TV shows with pagination, filters, and sorting
|
||||
$tvshows = TvShow::getAllWithPagination($this->pdo, $page, $perPage, $search, $genres, $years, $sort);
|
||||
|
||||
// Get total count for pagination
|
||||
$totalCount = TvShow::getTotalCount($this->pdo, $search, $genres, $years);
|
||||
|
||||
Reference in New Issue
Block a user