Store and return last modified as float
authorAdam Dullage <redacted>
Tue, 17 Oct 2023 07:20:22 +0000 (08:20 +0100)
committerAdam Dullage <redacted>
Tue, 17 Oct 2023 07:20:22 +0000 (08:20 +0100)
flatnotes/flatnotes.py
flatnotes/models.py

index 38babb9e9bbc1e4c1cca168c3681b9a4d43fbb86..1d9bf20ca2d8a5e22d30589b21a4345bcb2118b8 100644 (file)
@@ -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
index 07d3d38de95b719ea4d6bc293d8ca90f6acb57b8..b87d8bd5baaf2cf8e1bc45bf6cac6285ff4db057 100644 (file)
@@ -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)
git clone https://git.99rst.org/PROJECT