From 34f5be944080ecc6075301021ab0b233ddae7dda Mon Sep 17 00:00:00 2001 From: viown <48097677+viown@users.noreply.github.com> Date: Wed, 26 Mar 2025 22:07:51 +0300 Subject: [PATCH] Use shorthand syntax --- .../stable/features/search/api/fetchItemsByType.ts | 2 +- .../stable/features/search/api/useArtistsSearch.ts | 6 +++--- .../stable/features/search/api/useLiveTvSearch.ts | 14 +++++++------- .../stable/features/search/api/usePeopleSearch.ts | 4 ++-- .../features/search/api/useProgramsSearch.ts | 4 ++-- .../stable/features/search/api/useSearchItems.ts | 4 ++-- .../features/search/api/useSearchSuggestions.ts | 4 ++-- .../stable/features/search/api/useVideoSearch.ts | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/apps/stable/features/search/api/fetchItemsByType.ts b/src/apps/stable/features/search/api/fetchItemsByType.ts index dfe5edaa16..ec52347dbf 100644 --- a/src/apps/stable/features/search/api/fetchItemsByType.ts +++ b/src/apps/stable/features/search/api/fetchItemsByType.ts @@ -13,7 +13,7 @@ export const fetchItemsByType = async ( const response = await getItemsApi(api).getItems( { ...QUERY_OPTIONS, - userId: userId, + userId, recursive: true, ...params }, diff --git a/src/apps/stable/features/search/api/useArtistsSearch.ts b/src/apps/stable/features/search/api/useArtistsSearch.ts index def31ee0dc..4be8c70b57 100644 --- a/src/apps/stable/features/search/api/useArtistsSearch.ts +++ b/src/apps/stable/features/search/api/useArtistsSearch.ts @@ -17,7 +17,7 @@ const fetchArtists = async ( const response = await getArtistsApi(api).getArtists( { ...QUERY_OPTIONS, - userId: userId, + userId, ...params }, options @@ -39,8 +39,8 @@ export const useArtistsSearch = ( api!, userId!, { - parentId: parentId, - searchTerm: searchTerm + parentId, + searchTerm }, { signal } ), diff --git a/src/apps/stable/features/search/api/useLiveTvSearch.ts b/src/apps/stable/features/search/api/useLiveTvSearch.ts index 6cdde3602e..e4fef3386e 100644 --- a/src/apps/stable/features/search/api/useLiveTvSearch.ts +++ b/src/apps/stable/features/search/api/useLiveTvSearch.ts @@ -19,7 +19,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | { includeItemTypes: [ BaseItemKind.LiveTvProgram ], isMovie: true, - searchTerm: searchTerm + searchTerm }, { signal } ).then(moviesData => { @@ -40,7 +40,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | isSports: false, isKids: false, isNews: false, - searchTerm: searchTerm + searchTerm }, { signal } ).then(episodesData => { @@ -56,7 +56,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | { includeItemTypes: [ BaseItemKind.LiveTvProgram ], isSports: true, - searchTerm: searchTerm + searchTerm }, { signal } ).then(sportsData => { @@ -72,7 +72,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | { includeItemTypes: [ BaseItemKind.LiveTvProgram ], isKids: true, - searchTerm: searchTerm + searchTerm }, { signal } ).then(kidsData => { @@ -88,7 +88,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | { includeItemTypes: [ BaseItemKind.LiveTvProgram ], isNews: true, - searchTerm: searchTerm + searchTerm }, { signal } ).then(newsData => { @@ -108,7 +108,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | isSports: false, isKids: false, isNews: false, - searchTerm: searchTerm + searchTerm }, { signal } ).then(programsData => { @@ -123,7 +123,7 @@ const fetchLiveTv = (api: Api, userId: string | undefined, searchTerm: string | userId, { includeItemTypes: [ BaseItemKind.TvChannel ], - searchTerm: searchTerm + searchTerm }, { signal } ).then(channelsData => { diff --git a/src/apps/stable/features/search/api/usePeopleSearch.ts b/src/apps/stable/features/search/api/usePeopleSearch.ts index 943b611478..3dd1a74a59 100644 --- a/src/apps/stable/features/search/api/usePeopleSearch.ts +++ b/src/apps/stable/features/search/api/usePeopleSearch.ts @@ -17,7 +17,7 @@ const fetchPeople = async ( const response = await getPersonsApi(api).getPersons( { ...QUERY_OPTIONS, - userId: userId, + userId, ...params }, options @@ -41,7 +41,7 @@ export const usePeopleSearch = ( api!, userId!, { - searchTerm: searchTerm + searchTerm }, { signal } ), diff --git a/src/apps/stable/features/search/api/useProgramsSearch.ts b/src/apps/stable/features/search/api/useProgramsSearch.ts index 560c2e4682..23d91381b5 100644 --- a/src/apps/stable/features/search/api/useProgramsSearch.ts +++ b/src/apps/stable/features/search/api/useProgramsSearch.ts @@ -40,8 +40,8 @@ export const useProgramsSearch = ( api!, userId!, { - parentId: parentId, - searchTerm: searchTerm + parentId, + searchTerm }, { signal } ), diff --git a/src/apps/stable/features/search/api/useSearchItems.ts b/src/apps/stable/features/search/api/useSearchItems.ts index e16bdd67f7..b528290d87 100644 --- a/src/apps/stable/features/search/api/useSearchItems.ts +++ b/src/apps/stable/features/search/api/useSearchItems.ts @@ -64,8 +64,8 @@ export const useSearchItems = ( userId, { includeItemTypes: itemTypes, - parentId: parentId, - searchTerm: searchTerm, + parentId, + searchTerm, limit: 800 }, { signal } diff --git a/src/apps/stable/features/search/api/useSearchSuggestions.ts b/src/apps/stable/features/search/api/useSearchSuggestions.ts index 126783927a..af079fab11 100644 --- a/src/apps/stable/features/search/api/useSearchSuggestions.ts +++ b/src/apps/stable/features/search/api/useSearchSuggestions.ts @@ -14,7 +14,7 @@ const fetchGetItems = async ( ) => { const response = await getItemsApi(api).getItems( { - userId: userId, + userId, sortBy: [ItemSortBy.IsFavoriteOrLiked, ItemSortBy.Random], includeItemTypes: [ BaseItemKind.Movie, @@ -25,7 +25,7 @@ const fetchGetItems = async ( recursive: true, imageTypeLimit: 0, enableImages: false, - parentId: parentId, + parentId, enableTotalRecordCount: false }, options diff --git a/src/apps/stable/features/search/api/useVideoSearch.ts b/src/apps/stable/features/search/api/useVideoSearch.ts index 4ae736c076..06eaaf25e7 100644 --- a/src/apps/stable/features/search/api/useVideoSearch.ts +++ b/src/apps/stable/features/search/api/useVideoSearch.ts @@ -18,7 +18,7 @@ const fetchVideos = async ( const response = await getItemsApi(api).getItems( { ...QUERY_OPTIONS, - userId: userId, + userId, recursive: true, mediaTypes: [MediaType.Video], excludeItemTypes: [ @@ -47,8 +47,8 @@ export const useVideoSearch = ( api!, userId!, { - parentId: parentId, - searchTerm: searchTerm + parentId, + searchTerm }, { signal } ),