added a way to update invalid items
This commit is contained in:
parent
46ca0f0463
commit
facab26ff2
@ -683,6 +683,9 @@ class LibraryTab(ctk.CTkScrollableFrame):
|
||||
main_app.app.edit_workshop_id.delete(0, "end")
|
||||
main_app.app.edit_workshop_id.insert(0, workshop_id)
|
||||
main_app.app.main_button_event()
|
||||
if invalid_warn and check_config("update_invalid", "no") == "yes":
|
||||
main_app.app.download_map(update=True, invalid_item_folder=os.path.basename(folder))
|
||||
else:
|
||||
main_app.app.download_map(update=True)
|
||||
top.destroy()
|
||||
return
|
||||
@ -797,7 +800,9 @@ class LibraryTab(ctk.CTkScrollableFrame):
|
||||
update_btn.configure(state="disabled")
|
||||
update_btn_tooltip.configure(message="Currently offline")
|
||||
view_button_tooltip.configure(message="Currently offline")
|
||||
if invalid_warn:
|
||||
if check_config("update_invalid", "no") == "yes":
|
||||
update_btn_tooltip.configure(message="update_invalid is set to 'yes' in config.ini")
|
||||
elif invalid_warn:
|
||||
update_btn.configure(text="Update", state="disabled")
|
||||
update_btn_tooltip.configure(message="Disabled due to item being blocked or duplicated")
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ class BOIIIWD(ctk.CTk):
|
||||
self.after(0, callback)
|
||||
|
||||
@if_internet_available
|
||||
def download_map(self, update=False):
|
||||
def download_map(self, update=False, invalid_item_folder=None):
|
||||
self.is_downloading = False
|
||||
self.fail_threshold = 0
|
||||
if not self.is_pressed:
|
||||
@ -1029,7 +1029,7 @@ class BOIIIWD(ctk.CTk):
|
||||
start_down_thread = threading.Thread(target=self.queue_download_thread, args=(update,))
|
||||
start_down_thread.start()
|
||||
else:
|
||||
start_down_thread = threading.Thread(target=self.download_thread, args=(update,))
|
||||
start_down_thread = threading.Thread(target=self.download_thread, args=(update, invalid_item_folder,))
|
||||
start_down_thread.start()
|
||||
else:
|
||||
show_message("Warning", "Already pressed, Please wait.")
|
||||
@ -1389,7 +1389,7 @@ class BOIIIWD(ctk.CTk):
|
||||
self.stop_download()
|
||||
self.is_pressed = False
|
||||
|
||||
def download_thread(self, update=None):
|
||||
def download_thread(self, update=None, invalid_item_folder=None):
|
||||
try:
|
||||
self.settings_tab.stopped = False
|
||||
|
||||
@ -1580,6 +1580,9 @@ class BOIIIWD(ctk.CTk):
|
||||
items_file = os.path.join(APPLICATION_PATH, LIBRARY_FILE)
|
||||
item_exists,_ = self.library_tab.item_exists_in_file(items_file, workshop_id)
|
||||
|
||||
if invalid_item_folder:
|
||||
folder_name = invalid_item_folder
|
||||
else:
|
||||
if item_exists:
|
||||
get_folder_name = self.library_tab.get_item_by_id(items_file, workshop_id, return_option="folder_name")
|
||||
if get_folder_name:
|
||||
|
Loading…
Reference in New Issue
Block a user