mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 21:16:17 +02:00
remove the Priority queue type
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import clsx from 'clsx';
|
||||
import { forwardRef, ReactElement, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import styles from './play-queue.module.css';
|
||||
|
||||
@@ -23,20 +23,18 @@ import {
|
||||
useFollowCurrentSong,
|
||||
useListSettings,
|
||||
usePlayerActions,
|
||||
usePlayerQueueType,
|
||||
usePlayerSong,
|
||||
usePlayerStore,
|
||||
} from '/@/renderer/store';
|
||||
import { Flex } from '/@/shared/components/flex/flex';
|
||||
import { LoadingOverlay } from '/@/shared/components/loading-overlay/loading-overlay';
|
||||
import { Text } from '/@/shared/components/text/text';
|
||||
import { useDebouncedValue } from '/@/shared/hooks/use-debounced-value';
|
||||
import { useFocusWithin } from '/@/shared/hooks/use-focus-within';
|
||||
import { useHotkeys } from '/@/shared/hooks/use-hotkeys';
|
||||
import { useMergedRef } from '/@/shared/hooks/use-merged-ref';
|
||||
import { Folder, LibraryItem, QueueSong, Song } from '/@/shared/types/domain-types';
|
||||
import { DragTarget } from '/@/shared/types/drag-and-drop';
|
||||
import { ItemListKey, Play, PlayerQueueType } from '/@/shared/types/types';
|
||||
import { ItemListKey, Play } from '/@/shared/types/types';
|
||||
|
||||
type QueueProps = {
|
||||
enableScrollShadow?: boolean;
|
||||
@@ -52,7 +50,6 @@ export const PlayQueue = forwardRef<ItemListHandle, QueueProps>(
|
||||
const tableRef = useRef<ItemListHandle>(null);
|
||||
const mergedRef = useMergedRef(ref, tableRef);
|
||||
const { getQueue } = usePlayerActions();
|
||||
const queueType = usePlayerQueueType();
|
||||
const followCurrentSong = useFollowCurrentSong();
|
||||
|
||||
const [debouncedSearchTerm] = useDebouncedValue(searchTerm, 200);
|
||||
@@ -66,36 +63,7 @@ export const PlayQueue = forwardRef<ItemListHandle, QueueProps>(
|
||||
|
||||
setData(queue.items);
|
||||
|
||||
if (
|
||||
queueType === PlayerQueueType.PRIORITY &&
|
||||
queue.groups &&
|
||||
queue.groups.length > 0
|
||||
) {
|
||||
const transformedGroups: TableGroupHeader[] = queue.groups.map((group) => ({
|
||||
itemCount: group.count,
|
||||
render: (): ReactElement => {
|
||||
return (
|
||||
<div className={styles.groupRow}>
|
||||
<Text
|
||||
fw={600}
|
||||
overflow="visible"
|
||||
size="md"
|
||||
style={{
|
||||
textWrap: 'nowrap',
|
||||
whiteSpace: 'nowrap',
|
||||
}}
|
||||
>
|
||||
{group.name}
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
rowHeight: 40,
|
||||
}));
|
||||
setGroups(transformedGroups);
|
||||
} else {
|
||||
setGroups([]);
|
||||
}
|
||||
setGroups([]);
|
||||
};
|
||||
|
||||
const unsub = subscribePlayerQueue(() => {
|
||||
@@ -159,7 +127,7 @@ export const PlayQueue = forwardRef<ItemListHandle, QueueProps>(
|
||||
unsubCurrentTrack();
|
||||
eventEmitter.off('AUTODJ_QUEUE_ADDED', handleAutoDJQueueAdded);
|
||||
};
|
||||
}, [getQueue, queueType, tableRef, followCurrentSong]);
|
||||
}, [getQueue, tableRef, followCurrentSong]);
|
||||
|
||||
const filteredData: QueueSong[] = useMemo(() => {
|
||||
if (debouncedSearchTerm) {
|
||||
|
||||
Reference in New Issue
Block a user