1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

apply suggestion

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
grafixeyehero 2024-07-15 22:15:52 +03:00
parent 13d5cb2c84
commit fe31539d69
2 changed files with 13 additions and 14 deletions

View file

@ -24,8 +24,7 @@ const SearchFields: FC<SearchFieldsProps> = ({
const inputValue = inputRef.current?.value || ''; const inputValue = inputRef.current?.value || '';
if (value === 'backspace') { if (value === 'backspace') {
onSearch(inputValue.length ? inputValue.substring(0, inputValue.length - 1) : '' onSearch(inputValue.length ? inputValue.substring(0, inputValue.length - 1) : '');
);
} else { } else {
onSearch(inputValue + value); onSearch(inputValue + value);
} }

View file

@ -18,7 +18,7 @@ import { useApi } from '../useApi';
import type { CardOptions } from 'types/cardOptions'; import type { CardOptions } from 'types/cardOptions';
import { CardShape } from 'utils/card'; import { CardShape } from 'utils/card';
const Parameters_OPTIONS = { const QUERY_OPTIONS = {
limit: 100, limit: 100,
fields: [ fields: [
ItemFields.PrimaryImageAspectRatio, ItemFields.PrimaryImageAspectRatio,
@ -37,7 +37,7 @@ const fetchItemsByType = async (
) => { ) => {
const response = await getItemsApi(api).getItems( const response = await getItemsApi(api).getItems(
{ {
...Parameters_OPTIONS, ...QUERY_OPTIONS,
userId: userId, userId: userId,
recursive: true, recursive: true,
...params ...params
@ -55,7 +55,7 @@ const fetchPeople = async (
) => { ) => {
const response = await getPersonsApi(api).getPersons( const response = await getPersonsApi(api).getPersons(
{ {
...Parameters_OPTIONS, ...QUERY_OPTIONS,
userId: userId, userId: userId,
...params ...params
}, },
@ -72,7 +72,7 @@ const fetchArtists = async (
) => { ) => {
const response = await getArtistsApi(api).getArtists( const response = await getArtistsApi(api).getArtists(
{ {
...Parameters_OPTIONS, ...QUERY_OPTIONS,
userId: userId, userId: userId,
...params ...params
}, },
@ -93,7 +93,7 @@ const isTVShows = (collectionType: string) =>
const isLivetv = (collectionType: string) => const isLivetv = (collectionType: string) =>
collectionType === CollectionType.Livetv; collectionType === CollectionType.Livetv;
const Livetv_CARD_OPTIONS = { const LIVETV_CARD_OPTIONS = {
preferThumb: true, preferThumb: true,
inheritThumb: false, inheritThumb: false,
showParentTitleOrTitle: true, showParentTitleOrTitle: true,
@ -151,7 +151,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('Movies', moviesData.Items, { addSection('Movies', moviesData.Items, {
...Livetv_CARD_OPTIONS, ...LIVETV_CARD_OPTIONS,
shape: CardShape.PortraitOverflow shape: CardShape.PortraitOverflow
}); });
@ -171,7 +171,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('Episodes', episodesData.Items, { addSection('Episodes', episodesData.Items, {
...Livetv_CARD_OPTIONS ...LIVETV_CARD_OPTIONS
}); });
// Sports row // Sports row
@ -186,7 +186,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('Sports', sportsData.Items, { addSection('Sports', sportsData.Items, {
...Livetv_CARD_OPTIONS ...LIVETV_CARD_OPTIONS
}); });
// Kids row // Kids row
@ -201,7 +201,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('Kids', kidsData.Items, { addSection('Kids', kidsData.Items, {
...Livetv_CARD_OPTIONS ...LIVETV_CARD_OPTIONS
}); });
// News row // News row
@ -216,7 +216,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('News', newsData.Items, { addSection('News', newsData.Items, {
...Livetv_CARD_OPTIONS ...LIVETV_CARD_OPTIONS
}); });
// Programs row // Programs row
@ -235,7 +235,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('Programs', programsData.Items, { addSection('Programs', programsData.Items, {
...Livetv_CARD_OPTIONS ...LIVETV_CARD_OPTIONS
}); });
// Channels row // Channels row
@ -420,7 +420,7 @@ export const useSearchItems = (
{ signal } { signal }
); );
addSection('Programs', programsData.Items, { addSection('Programs', programsData.Items, {
...Livetv_CARD_OPTIONS ...LIVETV_CARD_OPTIONS
}); });
// Channels row // Channels row