none if id is not there

This commit is contained in:
faroukbmiled 2023-09-20 18:07:40 +01:00
parent 478d2a6652
commit 1195433771

View File

@ -217,7 +217,7 @@ class LibraryTab(ctk.CTkScrollableFrame):
# current folder name # current folder name
curr_folder_name = zone_path.parent.name curr_folder_name = zone_path.parent.name
workshop_id = extract_json_data(json_path, "PublisherID") workshop_id = extract_json_data(json_path, "PublisherID") or "None"
name = re.sub(r'\^\w+', '', extract_json_data(json_path, "Title")) name = re.sub(r'\^\w+', '', extract_json_data(json_path, "Title"))
name = name[:45] + "..." if len(name) > 45 else name name = name[:45] + "..." if len(name) > 45 else name
item_type = extract_json_data(json_path, "Type") item_type = extract_json_data(json_path, "Type")
@ -253,7 +253,7 @@ class LibraryTab(ctk.CTkScrollableFrame):
self.item_block_list.add(curr_folder_name) self.item_block_list.add(curr_folder_name)
image_path = b_mod_img if item_type == "mod" else b_map_img image_path = b_mod_img if item_type == "mod" else b_map_img
text_to_add += " | ⚠️" text_to_add += " | ⚠️"
elif curr_folder_name not in self.added_folders and workshop_id in self.ids_added: elif (curr_folder_name not in self.added_folders and (workshop_id in self.ids_added or workshop_id == "None")):
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
image_path = b_mod_img if item_type == "mod" else b_map_img image_path = b_mod_img if item_type == "mod" else b_map_img