remove the Priority queue type

This commit is contained in:
jeffvli
2026-01-18 18:32:35 -08:00
parent 04f7c7fdd4
commit 15633d07f0
6 changed files with 303 additions and 1145 deletions
-3
View File
@@ -631,9 +631,6 @@
"queue_moveToBottom": "move selected to top",
"queue_moveToTop": "move selected to bottom",
"queue_remove": "remove selected",
"queueType": "queue type",
"queueType_default": "default",
"queueType_priority": "priority",
"repeat": "repeat",
"repeat_all": "repeat all",
"repeat_off": "repeat disabled",
@@ -19,13 +19,7 @@ import {
import { LogCategory, logFn } from '/@/renderer/utils/logger';
import { logMsg } from '/@/renderer/utils/logger-message';
import { LyricSource, ServerType } from '/@/shared/types/domain-types';
import {
FontType,
Platform,
PlayerQueueType,
PlayerStyle,
PlayerType,
} from '/@/shared/types/types';
import { FontType, Platform, PlayerStyle, PlayerType } from '/@/shared/types/types';
const utils = isElectron() ? window.api.utils : null;
let appTrackerInFlight = false;
@@ -64,7 +58,6 @@ type AppTrackerProperties = PlayerProperties &
type PlayerProperties = {
'player.mediaSession': boolean;
'player.queueType': PlayerQueueType;
'player.style': PlayerStyle;
'player.transcoding': boolean;
'player.type': PlayerType;
@@ -117,7 +110,6 @@ type SettingsProperties = {
const getPlayerProperties = (): Pick<
AppTrackerProperties,
| 'player.mediaSession'
| 'player.queueType'
| 'player.style'
| 'player.transcoding'
| 'player.type'
@@ -128,7 +120,6 @@ const getPlayerProperties = (): Pick<
return {
'player.mediaSession': ignoreWeb(playbackSettings.mediaSession),
'player.queueType': player.player.queueType,
'player.style': player.player.transitionType,
'player.transcoding': playbackSettings.transcode.enabled,
'player.type': ignoreWeb(playbackSettings.type),
@@ -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) {
@@ -8,7 +8,6 @@ import {
usePlayerActions,
usePlayerData,
usePlayerProperties,
usePlayerQueueType,
usePlayerSpeed,
usePlayerStatus,
} from '/@/renderer/store';
@@ -27,13 +26,7 @@ import { Select } from '/@/shared/components/select/select';
import { Slider } from '/@/shared/components/slider/slider';
import { Switch } from '/@/shared/components/switch/switch';
import { toast } from '/@/shared/components/toast/toast';
import {
CrossfadeStyle,
PlayerQueueType,
PlayerStatus,
PlayerStyle,
PlayerType,
} from '/@/shared/types/types';
import { CrossfadeStyle, PlayerStatus, PlayerStyle, PlayerType } from '/@/shared/types/types';
const ipc = isElectron() ? window.api.ipc : null;
const mpvPlayer = isElectron() ? window.api.mpvPlayer : null;
@@ -60,11 +53,10 @@ export const PlayerConfig = () => {
const { t } = useTranslation();
const { currentSong } = usePlayerData();
const speed = usePlayerSpeed();
const queueType = usePlayerQueueType();
const status = usePlayerStatus();
const playbackType = usePlaybackType();
const { crossfadeDuration, crossfadeStyle, transitionType } = usePlayerProperties();
const { setCrossfadeDuration, setCrossfadeStyle, setQueueType, setSpeed, setTransitionType } =
const { setCrossfadeDuration, setCrossfadeStyle, setSpeed, setTransitionType } =
usePlayerActions();
const preservePitch = useSettingsStore((state) => state.playback.preservePitch);
const showLyricsInSidebar = useShowLyricsInSidebar();
@@ -130,34 +122,6 @@ export const PlayerConfig = () => {
};
const allOptions = [
{
component: (
<SegmentedControl
data={[
{
label: t('player.queueType_default', { postProcess: 'titleCase' }),
value: PlayerQueueType.DEFAULT,
},
{
label: t('player.queueType_priority', { postProcess: 'titleCase' }),
value: PlayerQueueType.PRIORITY,
},
]}
onChange={(value) => setQueueType(value as PlayerQueueType)}
size="sm"
value={queueType}
w="100%"
/>
),
id: 'queueType',
label: t('player.queueType', { postProcess: 'titleCase' }),
},
{
component: null,
id: 'divider-0',
isDivider: true,
label: '',
},
{
component: (
<Select
@@ -412,7 +376,6 @@ export const PlayerConfig = () => {
return allOptions;
}, [
t,
queueType,
playbackSettings,
status,
audioDevices,
@@ -424,7 +387,6 @@ export const PlayerConfig = () => {
setSpeed,
preservePitch,
currentSong?.bpm,
setQueueType,
setSettings,
setTransitionType,
setCrossfadeStyle,
File diff suppressed because it is too large Load Diff
-1
View File
@@ -68,7 +68,6 @@ export interface PlayerData {
export interface QueueData {
default: string[];
priority: string[];
shuffled: number[];
songs: Record<string, QueueSong>;
}