From 46e8db353c0d80e78e34d462f2b950a49a10d175 Mon Sep 17 00:00:00 2001 From: faroukbmiled Date: Thu, 21 Sep 2023 19:32:56 +0100 Subject: [PATCH] offline details edge case --- boiiiwd_package/src/library_tab.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/boiiiwd_package/src/library_tab.py b/boiiiwd_package/src/library_tab.py index d2a7b69..2bd5c6f 100644 --- a/boiiiwd_package/src/library_tab.py +++ b/boiiiwd_package/src/library_tab.py @@ -492,10 +492,14 @@ class LibraryTab(ctk.CTkScrollableFrame): return else: json_path = Path(folder) / "zone" / "workshop.json" + creation_timestamp = None for ff_file in json_path.parent.glob("*.ff"): if ff_file.exists(): creation_timestamp = ff_file.stat().st_ctime break + if not creation_timestamp: + creation_timestamp = json_path.parent.stat().st_ctime + if json_path.exists(): workshop_id = extract_json_data(json_path, "PublisherID") or "None" name = re.sub(r'\^\w+', '', extract_json_data(json_path, "Title")) or "None" @@ -520,6 +524,11 @@ class LibraryTab(ctk.CTkScrollableFrame): self.toplevel_info_window(map_name, map_mod_type, map_size, image, image_size, date_created, date_updated, stars_image, stars_image_size, ratings_text, url, workshop_id, invalid_warn, folder, offline_date) + else: + show_message("Warning", "Couldn't get offline information, Please connect to internet and try again") + for button_view in self.button_view_list: + button_view.configure(state="normal") + return info_thread = threading.Thread(target=show_map_thread)