Add slim endpoints for entities to speed up filters (#460)

* Move performers image column to end of table
* Remove redundant index
This commit is contained in:
InfiniteTF
2020-04-19 04:03:51 +02:00
committed by GitHub
parent 7ef0000744
commit 2a3c9742cc
14 changed files with 156 additions and 12 deletions

View File

@@ -183,7 +183,7 @@ export const FilterSelect: React.FC<IFilterProps & ITypeProps> = (props) =>
export const PerformerSelect: React.FC<IFilterProps> = (props) => {
const { data, loading } = StashService.useAllPerformersForFilter();
const normalizedData = data?.allPerformers ?? [];
const normalizedData = data?.allPerformersSlim ?? [];
const items: Option[] = normalizedData.map((item) => ({
value: item.id,
label: item.name ?? "",
@@ -216,7 +216,7 @@ export const PerformerSelect: React.FC<IFilterProps> = (props) => {
export const StudioSelect: React.FC<IFilterProps> = (props) => {
const { data, loading } = StashService.useAllStudiosForFilter();
const normalizedData = data?.allStudios ?? [];
const normalizedData = data?.allStudiosSlim ?? [];
const items = (normalizedData.length > 0
? [{ name: "None", id: "0" }, ...normalizedData]
@@ -254,7 +254,7 @@ export const StudioSelect: React.FC<IFilterProps> = (props) => {
export const MovieSelect: React.FC<IFilterProps> = (props) => {
const { data, loading } = StashService.useAllMoviesForFilter();
const normalizedData = data?.allMovies ?? [];
const normalizedData = data?.allMoviesSlim ?? [];
const items = (normalizedData.length > 0
? [{ name: "None", id: "0" }, ...normalizedData]
@@ -299,7 +299,7 @@ export const TagSelect: React.FC<IFilterProps> = (props) => {
const selectedTags = props.ids ?? selectedIds;
const tags = data?.allTags ?? [];
const tags = data?.allTagsSlim ?? [];
const selected = tags
.filter((tag) => selectedTags.indexOf(tag.id) !== -1)
.map((tag) => ({ value: tag.id, label: tag.name }));