From 9656d92865694b04f26f2d0ca4c6e456f53a1c30 Mon Sep 17 00:00:00 2001
From: faroukbmiled <fcfaroukfc@gmail.com>
Date: Fri, 22 Sep 2023 19:00:20 +0100
Subject: [PATCH] add

---
 boiiiwd_package/src/settings_tab.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boiiiwd_package/src/settings_tab.py b/boiiiwd_package/src/settings_tab.py
index 3623e14..70c413e 100644
--- a/boiiiwd_package/src/settings_tab.py
+++ b/boiiiwd_package/src/settings_tab.py
@@ -416,14 +416,14 @@ class SettingsTab(ctk.CTkFrame):
                     continue
                 json_path = os.path.join(zone_path, "workshop.json")
                 if os.path.exists(json_path):
+                    publisher_id = extract_json_data(json_path, 'PublisherID')
                     folder_to_rename = os.path.join(folder_path, folder_name)
                     new_folder_name = extract_json_data(json_path, option)
                     while new_folder_name in processed_names:
-                        new_folder_name += f"_{extract_json_data(json_path, 'PublisherID')}"
+                        new_folder_name += f"_{publisher_id}"
                     new_path = os.path.join(folder_path, new_folder_name)
 
                     while os.path.exists(new_path):
-                        publisher_id = extract_json_data(json_path, 'PublisherID')
                         new_folder_name += f"_{publisher_id}"
                         new_path = os.path.join(folder_path, new_folder_name)