Improve genres for jellyfin

- Support music folder
- Add images
- Fix genre filters on album/track filters
This commit is contained in:
jeffvli 2023-08-08 09:18:43 -07:00
parent 3f813b1a26
commit 7c59722f0a
11 changed files with 163 additions and 51 deletions

View file

@ -1,5 +1,6 @@
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { useCallback, useMemo, useRef } from 'react';
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import isEmpty from 'lodash/isEmpty';
import { useParams, useSearchParams } from 'react-router-dom';
import { GenreListSort, LibraryItem, SongListQuery, SortOrder } from '/@/renderer/api/types';
import { ListContext } from '/@/renderer/context/list-context';
@ -21,8 +22,8 @@ const TrackListRoute = () => {
const pageKey = albumArtistId ? `albumArtistSong` : 'song';
const customFilters: Partial<SongListQuery> = useMemo(() => {
return {
const customFilters = useMemo(() => {
const value = {
...(albumArtistId && { artistIds: [albumArtistId] }),
...(genreId && {
_custom: {
@ -35,6 +36,12 @@ const TrackListRoute = () => {
},
}),
};
if (isEmpty(value)) {
return undefined;
}
return value;
}, [albumArtistId, genreId]);
const handlePlayQueueAdd = usePlayQueueAdd();