fix(blacklist): request data only when modal is shown, remove useless ratelimit and lazy load blacklist (#1084)

* perf: remove eager load of Blacklist entity from Media entity

Try to resolve some performance issues by removing the eager loading of Blacklist items from the
Media entity

* fix: fix ManageSlideOver for blacklist

* perf(blacklist): request data only when modal is shown

For admin users, the button to blacklist a media (used on every media card) was displaying a Modal,
that was requesting data BEFORE the modal was displayed. This resulted in dozens of additional
requests everytime media cards were displayed.

* perf(blacklist): remove useless ratelimit
This commit is contained in:
Gauthier
2024-11-12 20:01:06 +01:00
committed by GitHub
parent a2d2fd3c2a
commit 694913c767
7 changed files with 67 additions and 22 deletions

View File

@@ -38,7 +38,7 @@ const BlacklistModal = ({
const intl = useIntl();
const { data, error } = useSWR<TvDetails | MovieDetails>(
`/api/v1/${type}/${tmdbId}`
show ? `/api/v1/${type}/${tmdbId}` : null
);
return (