Using divmod to calculate date parts. Using recommended datetime.now.

This commit is contained in:
Roland 2022-10-10 08:51:46 -06:00
parent f0f48164f5
commit e7fe65258c
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 14 additions and 27 deletions

View file

@ -32,8 +32,9 @@ class MapFile(Base, ModelHelper):
def __json__(self):
return {
'id': self.id,
'path': self.path,
'imported': self.imported,
'path': self.path,
'seconds_to_import': (seconds := seconds_to_import(self.path, self.size)),
'size': self.size,
'time_to_import': dates.seconds_to_timestamp(seconds_to_import(self.path, self.size)),
'time_to_import': dates.seconds_to_timestamp(seconds),
}