invalid items now have proper down dates

This commit is contained in:
faroukbmiled 2023-10-06 14:11:38 +01:00
parent facab26ff2
commit 5355675a6a
2 changed files with 12 additions and 1 deletions

View File

@ -635,6 +635,16 @@ class LibraryTab(ctk.CTkScrollableFrame):
if offline_date: if offline_date:
down_date = offline_date down_date = offline_date
elif invalid_warn:
try:
zone_path = Path(folder) / "zone"
for ff_file in zone_path.glob("*.ff"):
if ff_file.exists():
creation_timestamp = ff_file.stat().st_mtime
break
down_date = datetime.fromtimestamp(creation_timestamp).strftime("%d %b, %Y @ %I:%M%p")
except:
down_date = "Failed to get download date"
else: else:
down_date = self.get_item_by_id(items_file, workshop_id, 'date') down_date = self.get_item_by_id(items_file, workshop_id, 'date')

View File

@ -1625,6 +1625,7 @@ class BOIIIWD(ctk.CTk):
remove_tree(map_folder) remove_tree(map_folder)
remove_tree(download_folder) remove_tree(download_folder)
if not invalid_item_folder:
self.library_tab.update_item(self.edit_destination_folder.get(), workshop_id, mod_type, folder_name) self.library_tab.update_item(self.edit_destination_folder.get(), workshop_id, mod_type, folder_name)
self.show_complete_message(message=f"{mod_type.capitalize()} files were downloaded\nYou can run the game now!\nPS: You have to restart the game \n(pressing launch will launch/restarts)") self.show_complete_message(message=f"{mod_type.capitalize()} files were downloaded\nYou can run the game now!\nPS: You have to restart the game \n(pressing launch will launch/restarts)")
self.button_download.configure(state="normal") self.button_download.configure(state="normal")