Skip to content

Commit

Permalink
mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
seakrueger committed Sep 8, 2024
1 parent e5d8c0a commit e61ad6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tagstudio/src/qt/widgets/preview_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"<b>Date Created:</b> {dt.strftime(created, "%a, %x, %X")}"
Expand Down

0 comments on commit e61ad6e

Please sign in to comment.