Fix behavior when applying filters and switching pages (#7820)

* Fix filter handling

* Make Linter happy

* Make Linter happy
This commit is contained in:
Tim Eisele
2026-05-14 13:09:38 -04:00
committed by GitHub
parent 2f686e4598
commit a9f6c0aad9
5 changed files with 6 additions and 9 deletions
@@ -42,6 +42,7 @@ const Pagination: FC<PaginationProps> = ({
...prevState,
StartIndex: newIndex
}));
window.scrollTo(0, 0);
}, [limit, setLibraryViewSettings, startIndex]);
const onPreviousPageClick = useCallback(() => {
@@ -50,6 +51,7 @@ const Pagination: FC<PaginationProps> = ({
...prevState,
StartIndex: newIndex
}));
window.scrollTo(0, 0);
}, [limit, setLibraryViewSettings, startIndex]);
return (
@@ -161,13 +161,6 @@ const FilterButton: FC<FilterButtonProps> = ({
);
};
const isFiltersVideoTypesEnabled = () => {
return (
viewType === LibraryTab.Movies
|| viewType === LibraryTab.Episodes
);
};
const isFiltersSeriesStatusEnabled = () => {
return viewType === LibraryTab.Series;
};
@@ -301,7 +294,7 @@ const FilterButton: FC<FilterButtonProps> = ({
</Accordion>
)}
{isFiltersVideoTypesEnabled() && (
{isFiltersFeaturesEnabled() && (
<Accordion
expanded={expanded === 'filtersVideoTypes'}
onChange={handleChange('filtersVideoTypes')}
@@ -40,6 +40,7 @@ const FiltersVideoTypes: FC<FiltersVideoTypesProps> = ({
setLibraryViewSettings((prevState) => ({
...prevState,
StartIndex: 0,
Filters: {
...prevState.Filters,
VideoBasicFilter: updatedVideoBasicFilter.length ? updatedVideoBasicFilter : undefined
+1 -1
View File
@@ -139,7 +139,7 @@ function setVisibility(context, options) {
context.querySelector('.yearFilters').classList.remove('hide');
}
if (options.mode === 'movies' || options.mode === 'episodes') {
if (options.mode === 'movies' || options.mode === 'series' || options.mode === 'episodes') {
context.querySelector('.videoTypeFilters').classList.remove('hide');
}
+1
View File
@@ -177,6 +177,7 @@ export default function (view, params, tabContent) {
serverId: ApiClient.serverId()
});
Events.on(filterDialog, 'filterchange', function () {
getQuery().StartIndex = 0;
reloadItems(tabContent);
});
filterDialog.show();