mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
Merge remote-tracking branch 'origin/main' into dev
This commit is contained in:
@@ -126,6 +126,9 @@ export function MediaItemList<PageDataType, ItemType>(
|
||||
});
|
||||
};
|
||||
|
||||
const listHeight =
|
||||
containerHeight && containerHeight < 800 ? 800 : (containerHeight ?? 800);
|
||||
|
||||
return (
|
||||
<Box
|
||||
ref={containerRef}
|
||||
@@ -137,7 +140,7 @@ export function MediaItemList<PageDataType, ItemType>(
|
||||
{isFetchingNextPage && <LinearProgress />}
|
||||
<Box ref={gridContainerRef} sx={{ width: '100%' }}>
|
||||
<FixedSizeList
|
||||
height={containerHeight ?? 800}
|
||||
height={listHeight}
|
||||
width={'100%'}
|
||||
itemSize={61}
|
||||
itemCount={loadedItems.length}
|
||||
|
||||
@@ -85,8 +85,10 @@ export const LibraryProgramGrid = ({
|
||||
const programHierarchy = useProgramHierarchy(
|
||||
useCallback((p: ProgramOrFolder) => p.uuid, []),
|
||||
);
|
||||
const currentParentContext =
|
||||
last(parentContext) ?? last(programHierarchy.parentContext);
|
||||
const currentParentContext = useMemo(
|
||||
() => last(parentContext) ?? last(programHierarchy.parentContext),
|
||||
[parentContext, programHierarchy.parentContext],
|
||||
);
|
||||
|
||||
const query = useMemo<SearchRequest>(() => {
|
||||
if (currentParentContext) {
|
||||
|
||||
@@ -17,7 +17,6 @@ export const PointAndClickSearchBuilder = ({
|
||||
}: Props) => {
|
||||
const form = useFormContext<SearchForm>();
|
||||
const filter = form.watch('filter');
|
||||
console.log(filter);
|
||||
|
||||
return (
|
||||
<FormProvider {...form}>
|
||||
@@ -29,9 +28,7 @@ export const PointAndClickSearchBuilder = ({
|
||||
fullWidth
|
||||
value={
|
||||
filter.type === 'structured'
|
||||
? search.searchFilterToString(
|
||||
search.normalizeSearchFilter(filter.filter),
|
||||
)
|
||||
? search.searchFilterToString(filter.filter)
|
||||
: ''
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
Tooltip,
|
||||
} from '@mui/material';
|
||||
import type { MediaSourceId } from '@tunarr/shared';
|
||||
import type { SearchRequest } from '@tunarr/types/schemas';
|
||||
import { isEmpty, isNil } from 'lodash-es';
|
||||
import { useCallback } from 'react';
|
||||
import type { FieldPathValue, Validate } from 'react-hook-form';
|
||||
@@ -22,7 +21,6 @@ import type { SearchForm } from './SearchInput.tsx';
|
||||
import { SearchInputToggle } from './SearchInputToggle.tsx';
|
||||
|
||||
type SearchBuilderProps = {
|
||||
onSearch: (query: SearchRequest) => void;
|
||||
mediaSourceId?: MediaSourceId;
|
||||
libraryId?: string;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,6 @@ import { difference, isEmpty, isEqual } from 'lodash-es';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import type { SubmitHandler } from 'react-hook-form';
|
||||
import { Controller, FormProvider, useForm } from 'react-hook-form';
|
||||
import { normalizeSearchFilter } from '../../../../shared/dist/src/util/searchUtil';
|
||||
import { useSearchQueryParser } from '../../hooks/useSearchQueryParser.ts';
|
||||
import { setSearchRequest } from '../../store/programmingSelector/actions.ts';
|
||||
import type { Maybe, Nullable } from '../../types/util.ts';
|
||||
@@ -120,10 +119,6 @@ export const SearchInput = ({
|
||||
const { getSearchExpression, parseToSearchFilterOrNull } =
|
||||
useSearchQueryParser();
|
||||
|
||||
const handleSearchChange = useCallback((searchRequest: SearchRequest) => {
|
||||
setSearchRequest(searchRequest);
|
||||
}, []);
|
||||
|
||||
const [keywordSearch, setKeywordSearch] = useState('');
|
||||
|
||||
const [searchRestrictEl, setSearchRestrictEl] =
|
||||
@@ -147,11 +142,6 @@ export const SearchInput = ({
|
||||
filter = formData.filter.filter;
|
||||
}
|
||||
|
||||
if (filter) {
|
||||
console.log(filter);
|
||||
filter = normalizeSearchFilter(filter);
|
||||
}
|
||||
|
||||
const search: SearchRequest = {
|
||||
query: isNonEmptyString(formData.keywords)
|
||||
? formData.keywords
|
||||
@@ -252,7 +242,6 @@ export const SearchInput = ({
|
||||
<SearchFilterBuilder
|
||||
libraryId={libraryId}
|
||||
mediaSourceId={mediaSourceId}
|
||||
onSearch={handleSearchChange}
|
||||
/>
|
||||
<Box sx={{ width: '100%' }}>
|
||||
<Stack direction={'row'}>
|
||||
|
||||
@@ -273,7 +273,10 @@ export function SearchValueNode(props: ValueNodeProps) {
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
{renderValueInput}
|
||||
{/* value editor: wrap in a FormControl to enforce a width */}
|
||||
<FormControl size="small" sx={{ minWidth: 400 }}>
|
||||
{renderValueInput}
|
||||
</FormControl>
|
||||
{!only && (
|
||||
<span>
|
||||
<IconButton onClick={() => remove(index)}>
|
||||
|
||||
Reference in New Issue
Block a user