From e61ad6ebe4a5b2a864512cf1941d541d1c633e53 Mon Sep 17 00:00:00 2001 From: Sean Krueger Date: Sat, 7 Sep 2024 21:15:18 -0500 Subject: [PATCH] mypy errors --- tagstudio/src/qt/widgets/preview_panel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tagstudio/src/qt/widgets/preview_panel.py b/tagstudio/src/qt/widgets/preview_panel.py index 72d00e6a3..9e62f64fd 100644 --- a/tagstudio/src/qt/widgets/preview_panel.py +++ b/tagstudio/src/qt/widgets/preview_panel.py @@ -492,10 +492,11 @@ def add_field_to_selected(self, field_list: list[QModelIndex]): def update_date_label(self, filepath: Path | None = None) -> None: """Update the "Date Created" and "Date Modified" file property labels.""" if filepath and filepath.is_file(): + created: dt = None if platform.system() == "Windows" or platform.system() == "Darwin": - created: dt = dt.fromtimestamp(filepath.stat().st_birthtime) + created = dt.fromtimestamp(filepath.stat().st_birthtime) # type: ignore[attr-defined] else: - created: dt = dt.fromtimestamp(filepath.stat().st_ctime) + created = dt.fromtimestamp(filepath.stat().st_ctime) modified: dt = dt.fromtimestamp(filepath.stat().st_mtime) self.date_created_label.setText( f"Date Created: {dt.strftime(created, "%a, %x, %X")}"