mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
feat: implement missing/trashed items (#1481)
Also fixes an issue where the root of a local library would not be searched for videos. This allows for a flat directory structure for both movie and 'other video' libraries. Lastly, this fixes an issue where search query state would be wonky in the UI. fix: make audio/subtitle language optional in nfo schemas
This commit is contained in:
committed by
GitHub
parent
ac75b3c2f5
commit
18cdbcb57d
@@ -35,7 +35,7 @@ type Props = {
|
||||
disableProgramSelection?: boolean;
|
||||
depth?: number;
|
||||
parentContext?: ProgramOrFolder[];
|
||||
initialSearchQuery?: string;
|
||||
searchRequest?: SearchRequest;
|
||||
};
|
||||
|
||||
function searchItemTypeFromContentType(
|
||||
@@ -74,6 +74,7 @@ export const LibraryProgramGrid = ({
|
||||
disableProgramSelection,
|
||||
depth = 0,
|
||||
parentContext = [],
|
||||
searchRequest: staticSearchRequest,
|
||||
}: Props) => {
|
||||
const searchRequest = useStore((s) => s.currentSearchRequest);
|
||||
const currentParentContext = last(parentContext);
|
||||
@@ -89,6 +90,10 @@ export const LibraryProgramGrid = ({
|
||||
};
|
||||
}
|
||||
|
||||
if (staticSearchRequest) {
|
||||
return staticSearchRequest;
|
||||
}
|
||||
|
||||
const filter = match([searchRequest?.filter, mediaSource, library])
|
||||
.returnType<SearchFilter | null>()
|
||||
.with([P.select(P.nonNullable), P._, P._], (filter) => filter)
|
||||
@@ -99,6 +104,7 @@ export const LibraryProgramGrid = ({
|
||||
typeFilter(mediaType),
|
||||
)
|
||||
.otherwise(() => null);
|
||||
console.log(filter);
|
||||
|
||||
return {
|
||||
query: searchRequest?.query,
|
||||
@@ -112,6 +118,7 @@ export const LibraryProgramGrid = ({
|
||||
searchRequest?.filter,
|
||||
searchRequest?.query,
|
||||
searchRequest?.restrictSearchTo,
|
||||
staticSearchRequest,
|
||||
]);
|
||||
|
||||
const search = useInfiniteQuery({
|
||||
|
||||
Reference in New Issue
Block a user