From 9dce7874a4d84dd1f532309d7c2cb750b2c69787 Mon Sep 17 00:00:00 2001 From: mbrucedogs Date: Mon, 21 Jul 2025 08:28:57 -0500 Subject: [PATCH] Signed-off-by: mbrucedogs --- src/hooks/useSongOperations.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/useSongOperations.ts b/src/hooks/useSongOperations.ts index 0a1f2aa..8d5e08f 100644 --- a/src/hooks/useSongOperations.ts +++ b/src/hooks/useSongOperations.ts @@ -22,6 +22,11 @@ export const useSongOperations = () => { try { // Calculate the next order by finding the highest order value and adding 1 const queueItems = Object.values(currentQueue) as QueueItem[]; + // Prevent duplicate song/singer pairs + const duplicate = queueItems.find(item => item.song.path === song.path && item.singer.name === currentSinger); + if (duplicate) { + throw new Error('This song is already in the queue for this singer.'); + } const maxOrder = queueItems.length > 0 ? Math.max(...queueItems.map(item => item.order || 0)) : 0;