From e68c3f2ca6d2e9d63c453440ae1f331eab726bef Mon Sep 17 00:00:00 2001
From: DJSchaffner <jonas.wilkens@outlook.com>
Date: Wed, 1 Jan 2025 20:02:00 +0100
Subject: [PATCH] Fixed duplicate items per set showing as "Sets:
 <name>,<name>"

---
 .vscode/settings.json | 2 +-
 main.lua              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.vscode/settings.json b/.vscode/settings.json
index 2dd91bd..0f8ca85 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -45,6 +45,6 @@
   "Lua.workspace.library": [
     "C:\\Users\\schaffner\\lua\\ItemRack",
     "C:\\Users\\schaffner\\lua\\BetterBags",
-    "~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations"
+    "~\\.vscode\\extensions\\ketho.wow-api-0.18.1\\Annotations"
   ]
 }
diff --git a/main.lua b/main.lua
index bc4dad6..97a6c80 100644
--- a/main.lua
+++ b/main.lua
@@ -61,8 +61,8 @@ local function updateCategories()
 
 					if itemSets == nil then
 						usedItems[id] = { setName }
-					-- Extend existing labels
-					else
+					-- Extend existing labels and filter duplicate items per set
+					elseif usedItems[id][setName] ~= nil then
 						table.insert(usedItems[id], setName)
 					end
 				end