Added raw timestamps to PhotoInfo._info

This commit is contained in:
Rhet Turnbull
2020-08-24 06:00:57 -07:00
parent 1f717b0579
commit 0f457a4082
2 changed files with 5 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
""" version info """ """ version info """
__version__ = "0.33.3" __version__ = "0.33.4"

View File

@@ -932,6 +932,7 @@ class PhotosDB:
# There are sometimes negative values for lastmodifieddate in the database # There are sometimes negative values for lastmodifieddate in the database
# I don't know what these mean but they will raise exception in datetime if # I don't know what these mean but they will raise exception in datetime if
# not accounted for # not accounted for
self._dbphotos[uuid]["lastmodifieddate_timestamp"] = row[4]
try: try:
self._dbphotos[uuid]["lastmodifieddate"] = datetime.fromtimestamp( self._dbphotos[uuid]["lastmodifieddate"] = datetime.fromtimestamp(
row[4] + TIME_DELTA row[4] + TIME_DELTA
@@ -942,6 +943,7 @@ class PhotosDB:
self._dbphotos[uuid]["lastmodifieddate"] = None self._dbphotos[uuid]["lastmodifieddate"] = None
self._dbphotos[uuid]["imageTimeZoneOffsetSeconds"] = row[9] self._dbphotos[uuid]["imageTimeZoneOffsetSeconds"] = row[9]
self._dbphotos[uuid]["imageDate_timestamp"] = row[5]
try: try:
imagedate = datetime.fromtimestamp(row[5] + TIME_DELTA) imagedate = datetime.fromtimestamp(row[5] + TIME_DELTA)
@@ -1798,6 +1800,7 @@ class PhotosDB:
# There are sometimes negative values for lastmodifieddate in the database # There are sometimes negative values for lastmodifieddate in the database
# I don't know what these mean but they will raise exception in datetime if # I don't know what these mean but they will raise exception in datetime if
# not accounted for # not accounted for
info["lastmodifieddate_timestamp"] = row[4]
try: try:
info["lastmodifieddate"] = datetime.fromtimestamp(row[4] + TIME_DELTA) info["lastmodifieddate"] = datetime.fromtimestamp(row[4] + TIME_DELTA)
except ValueError: except ValueError:
@@ -1806,6 +1809,7 @@ class PhotosDB:
info["lastmodifieddate"] = None info["lastmodifieddate"] = None
info["imageTimeZoneOffsetSeconds"] = row[6] info["imageTimeZoneOffsetSeconds"] = row[6]
info["imageDate_timestamp"] = row[5]
try: try:
imagedate = datetime.fromtimestamp(row[5] + TIME_DELTA) imagedate = datetime.fromtimestamp(row[5] + TIME_DELTA)