From 9009e25cb1a7864127f6b2dc7329bd4178ad3a5d Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Fri, 2 Jun 2023 16:12:24 -0400 Subject: Apply suggestions from code review Co-authored-by: Aarni Koskela --- modules/ui_extra_networks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/ui_extra_networks.py') diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 8142811a..a7d3bc79 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -210,10 +210,12 @@ class ExtraNetworksPage: """ List of default keys used for sorting in the UI. """ + pth = Path(path) + stat = pth.stat() return { - "date_created": int(Path(path).stat().st_ctime or 0), - "date_modified": int(Path(path).stat().st_mtime or 0), - "name": Path(path).name.lower(), + "date_created": int(stat.st_ctime or 0), + "date_modified": int(stat.st_mtime or 0), + "name": pth.name.lower(), } def find_preview(self, path): -- cgit v1.2.1