mirror of
https://github.com/jeffvli/sonixd.git
synced 2026-04-29 02:32:37 -04:00
Disable unused columns by server type
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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'] : []}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ const ColumnSort = ({
|
||||
setSortType,
|
||||
setSortColumn,
|
||||
clearSortType,
|
||||
disabledItemValues,
|
||||
}: any) => {
|
||||
const sortFilterPickerContainerRef = useRef<any>();
|
||||
|
||||
@@ -42,6 +43,7 @@ const ColumnSort = ({
|
||||
value={sortColumn}
|
||||
labelKey="label"
|
||||
valueKey="dataKey"
|
||||
disabledItemValues={disabledItemValues}
|
||||
virtualized
|
||||
cleanable={false}
|
||||
style={{ width: '250px' }}
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user