From: Adam Dullage Date: Tue, 17 Oct 2023 07:20:22 +0000 (+0100) Subject: Store and return last modified as float X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=3d8ed80f295dbad110cec5be979a282967822e73;p=flatnotes.git Store and return last modified as float --- diff --git a/flatnotes/flatnotes.py b/flatnotes/flatnotes.py index 38babb9..1d9bf20 100644 --- a/flatnotes/flatnotes.py +++ b/flatnotes/flatnotes.py @@ -64,7 +64,7 @@ class Note: @property def last_modified(self): - return int(os.path.getmtime(self.filepath)) + return os.path.getmtime(self.filepath) # Editable Properties @property diff --git a/flatnotes/models.py b/flatnotes/models.py index 07d3d38..b87d8bd 100644 --- a/flatnotes/models.py +++ b/flatnotes/models.py @@ -32,7 +32,7 @@ class NotePostModel(CustomBaseModel): class NoteResponseModel(CustomBaseModel): title: str - last_modified: int + last_modified: float class NoteContentResponseModel(NoteResponseModel): @@ -47,7 +47,7 @@ class NotePatchModel(CustomBaseModel): class SearchResultModel(CustomBaseModel): score: Optional[float] = Field(None) title: str - last_modified: int + last_modified: float title_highlights: Optional[str] = Field(None) content_highlights: Optional[str] = Field(None) tag_matches: Optional[List[str]] = Field(None)