mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Filter category options based on selected type in VODsPage component
This commit is contained in:
parent
45817c699f
commit
307bd25e3e
1 changed files with 10 additions and 4 deletions
|
|
@ -375,10 +375,16 @@ const VODsPage = () => {
|
|||
|
||||
const categoryOptions = [
|
||||
{ value: '', label: 'All Categories' },
|
||||
...Object.values(categories).map((cat) => ({
|
||||
value: `${cat.name}|${cat.category_type}`, // Combine name and type for uniqueness
|
||||
label: `${cat.name} (${cat.category_type})`, // Show type in label for clarity
|
||||
})),
|
||||
...Object.values(categories)
|
||||
.filter((cat) => {
|
||||
if (filters.type === 'movies') return cat.category_type === 'movie';
|
||||
if (filters.type === 'series') return cat.category_type === 'series';
|
||||
return true; // 'all' shows all
|
||||
})
|
||||
.map((cat) => ({
|
||||
value: `${cat.name}|${cat.category_type}`,
|
||||
label: `${cat.name} (${cat.category_type})`,
|
||||
})),
|
||||
];
|
||||
|
||||
const totalPages = Math.ceil(totalCount / pageSize);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue