diff --git a/src/components/library/AlbumList.tsx b/src/components/library/AlbumList.tsx index a158d31..6a26fb4 100644 --- a/src/components/library/AlbumList.tsx +++ b/src/components/library/AlbumList.tsx @@ -257,6 +257,9 @@ const AlbumList = () => { value={album.active.filter} groupBy="role" data={sortTypes} + disabledItemValues={ + config.serverType === Server.Jellyfin ? ['frequent', 'recent'] : [] + } cleanable={false} placeholder="Sort Type" onChange={async (value: string) => { @@ -317,6 +320,9 @@ const AlbumList = () => { sortColumns={sortColumns} sortColumn={album.advancedFilters.properties.sort.column} sortType={album.advancedFilters.properties.sort.type} + disabledItemValues={ + config.serverType === Server.Jellyfin ? ['playCount', 'userRating'] : [] + } clearSortType={() => dispatch( setAdvancedFilters({ diff --git a/src/components/library/ArtistList.tsx b/src/components/library/ArtistList.tsx index 2219752..56eb19c 100644 --- a/src/components/library/ArtistList.tsx +++ b/src/components/library/ArtistList.tsx @@ -161,6 +161,9 @@ const ArtistList = () => { sortColumns={sortColumns} sortColumn={artist.active.list.sort.column} sortType={artist.active.list.sort.type} + disabledItemValues={ + config.serverType === Server.Jellyfin ? ['albumCount', 'userRating'] : ['duration'] + } clearSortType={() => dispatch( setSort({ diff --git a/src/components/playlist/PlaylistList.tsx b/src/components/playlist/PlaylistList.tsx index 64275b2..2154baf 100644 --- a/src/components/playlist/PlaylistList.tsx +++ b/src/components/playlist/PlaylistList.tsx @@ -28,7 +28,7 @@ import { } from '../../redux/multiSelectSlice'; import { apiController } from '../../api/controller'; import useColumnSort from '../../hooks/useColumnSort'; -import { Item } from '../../types'; +import { Item, Server } from '../../types'; import { setSort } from '../../redux/playlistSlice'; import ColumnSortPopover from '../shared/ColumnSortPopover'; @@ -124,6 +124,9 @@ const PlaylistList = () => { sortColumns={sortColumns} sortColumn={playlist.active.list.sort.column} sortType={playlist.active.list.sort.type} + disabledItemValues={ + config.serverType === Server.Jellyfin ? ['changed', 'owner', 'public'] : [] + } clearSortType={() => dispatch( setSort({ diff --git a/src/components/settings/ConfigPanels/ListViewConfig.tsx b/src/components/settings/ConfigPanels/ListViewConfig.tsx index 5d1a329..ce1ab7f 100644 --- a/src/components/settings/ConfigPanels/ListViewConfig.tsx +++ b/src/components/settings/ConfigPanels/ListViewConfig.tsx @@ -51,7 +51,13 @@ const columnSelectorColumns = [ }, ]; -const ListViewConfig = ({ defaultColumns, columnPicker, columnList, settingsConfig }: any) => { +const ListViewConfig = ({ + defaultColumns, + columnPicker, + columnList, + settingsConfig, + disabledItemValues, +}: any) => { const dispatch = useAppDispatch(); const playQueue = useAppSelector((state) => state.playQueue); const multiSelect = useAppSelector((state) => state.multiSelect); @@ -112,6 +118,7 @@ const ListViewConfig = ({ defaultColumns, columnPicker, columnList, settingsConf data={columnPicker} defaultValue={defaultColumns} value={selectedColumns} + disabledItemValues={disabledItemValues} style={{ width: '100%' }} onChange={(e: any) => { const columns: any[] = []; diff --git a/src/components/settings/ConfigPanels/LookAndFeelConfig.tsx b/src/components/settings/ConfigPanels/LookAndFeelConfig.tsx index 32a8070..38b52e7 100644 --- a/src/components/settings/ConfigPanels/LookAndFeelConfig.tsx +++ b/src/components/settings/ConfigPanels/LookAndFeelConfig.tsx @@ -37,6 +37,7 @@ import { setGridCardSize, setGridGapSize, } from '../../../redux/configSlice'; +import { Server } from '../../../types'; export const ListViewConfigPanel = ({ bordered }: any) => { const dispatch = useAppDispatch(); @@ -84,6 +85,7 @@ export const ListViewConfigPanel = ({ bordered }: any) => { rowHeight: 'musicListRowHeight', fontSize: 'musicListFontSize', }} + disabledItemValues={config.serverType === Server.Jellyfin ? ['Path'] : []} /> )} @@ -98,6 +100,7 @@ export const ListViewConfigPanel = ({ bordered }: any) => { rowHeight: 'albumListRowHeight', fontSize: 'albumListFontSize', }} + disabledItemValues={config.serverType === Server.Jellyfin ? ['Rating'] : []} /> )} @@ -112,6 +115,11 @@ export const ListViewConfigPanel = ({ bordered }: any) => { rowHeight: 'playlistListRowHeight', fontSize: 'playlistListFontSize', }} + disabledItemValues={ + config.serverType === Server.Jellyfin + ? ['Modified', 'Owner', 'Track Count', 'Visibility'] + : [] + } /> )} @@ -126,6 +134,9 @@ export const ListViewConfigPanel = ({ bordered }: any) => { rowHeight: 'artistListRowHeight', fontSize: 'artistListFontSize', }} + disabledItemValues={ + config.serverType === Server.Jellyfin ? ['Album Count', 'Rating'] : ['Duration'] + } /> )} @@ -140,6 +151,9 @@ export const ListViewConfigPanel = ({ bordered }: any) => { rowHeight: 'genreListRowHeight', fontSize: 'genreListFontSize', }} + disabledItemValues={ + config.serverType === Server.Jellyfin ? ['Album Count', 'Track Count'] : [] + } /> )} @@ -154,6 +168,7 @@ export const ListViewConfigPanel = ({ bordered }: any) => { rowHeight: 'miniListRowHeight', fontSize: 'miniListFontSize', }} + disabledItemValues={config.serverType === Server.Jellyfin ? ['Path'] : []} /> )} diff --git a/src/components/shared/ColumnSort.tsx b/src/components/shared/ColumnSort.tsx index f1f1f60..0ac3153 100644 --- a/src/components/shared/ColumnSort.tsx +++ b/src/components/shared/ColumnSort.tsx @@ -10,6 +10,7 @@ const ColumnSort = ({ setSortType, setSortColumn, clearSortType, + disabledItemValues, }: any) => { const sortFilterPickerContainerRef = useRef(); @@ -42,6 +43,7 @@ const ColumnSort = ({ value={sortColumn} labelKey="label" valueKey="dataKey" + disabledItemValues={disabledItemValues} virtualized cleanable={false} style={{ width: '250px' }} diff --git a/src/components/starred/StarredView.tsx b/src/components/starred/StarredView.tsx index 65f6c30..02d1f0b 100644 --- a/src/components/starred/StarredView.tsx +++ b/src/components/starred/StarredView.tsx @@ -28,7 +28,7 @@ import { setActive, setSort } from '../../redux/favoriteSlice'; import { apiController } from '../../api/controller'; import { setPlaylistRate } from '../../redux/playlistSlice'; import useColumnSort from '../../hooks/useColumnSort'; -import { Item } from '../../types'; +import { Item, Server } from '../../types'; import { FilterButton } from '../shared/ToolbarButtons'; import ColumnSortPopover from '../shared/ColumnSortPopover'; @@ -199,6 +199,15 @@ const StarredView = () => { ? favorite.active.album.sort.type : favorite.active.artist.sort.type } + disabledItemValues={ + config.serverType === Server.Jellyfin + ? favorite.active.tab === 'albums' + ? ['playCount', 'userRating'] + : ['albumCount', 'userRating'] + : favorite.active.tab === 'albums' + ? [] + : ['duration'] + } clearSortType={() => dispatch( setSort({