major edge case

This commit is contained in:
faroukbmiled 2023-09-22 18:38:33 +01:00
parent b0257d153b
commit dcf6f71f38
2 changed files with 9 additions and 6 deletions

View File

@ -254,7 +254,8 @@ class LibraryTab(ctk.CTkScrollableFrame):
mod_count += 1 if item_type == "mod" else 0 mod_count += 1 if item_type == "mod" else 0
if curr_folder_name not in self.added_folders: if curr_folder_name not in self.added_folders:
image_path = mod_img if item_type == "mod" else map_img image_path = mod_img if item_type == "mod" else map_img
if not (str(curr_folder_name).strip() == str(workshop_id).strip() or str(curr_folder_name).strip() == str(folder_name).strip()): if not (str(curr_folder_name).strip() == str(workshop_id).strip() or str(curr_folder_name).strip() == str(folder_name).strip()
or str(curr_folder_name).strip() == f"{folder_name}_{workshop_id}"):
try: self.remove_item_by_option(items_file, curr_folder_name, "folder_name") try: self.remove_item_by_option(items_file, curr_folder_name, "folder_name")
except: pass except: pass
self.item_block_list.add(curr_folder_name) self.item_block_list.add(curr_folder_name)
@ -300,7 +301,9 @@ class LibraryTab(ctk.CTkScrollableFrame):
# keep here cuz of item_exists_in_file() testing # keep here cuz of item_exists_in_file() testing
self.added_folders.add(curr_folder_name) self.added_folders.add(curr_folder_name)
if not workshop_id in self.ids_added: # added that cuz it sometimes can add blocked ids first
# and legit ids will be blocked cuz theyll be added to "ids_added"
if not workshop_id in self.ids_added and curr_folder_name not in self.item_block_list:
self.ids_added.add(workshop_id) self.ids_added.add(workshop_id)
if not self.file_cleaned and os.path.exists(items_file): if not self.file_cleaned and os.path.exists(items_file):

View File

@ -412,7 +412,7 @@ class SettingsTab(ctk.CTkFrame):
zone_path = os.path.join(folder_path, folder_name, "zone") zone_path = os.path.join(folder_path, folder_name, "zone")
if not os.path.isdir(zone_path): if not os.path.isdir(zone_path):
continue continue
if zone_path in main_app.app.library_tab.item_block_list: if folder_name in main_app.app.library_tab.item_block_list:
continue continue
json_path = os.path.join(zone_path, "workshop.json") json_path = os.path.join(zone_path, "workshop.json")
if os.path.exists(json_path): if os.path.exists(json_path):