Minor refactoring in photoinfo.py
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
""" version info """
|
""" version info """
|
||||||
|
|
||||||
__version__ = "0.29.26"
|
__version__ = "0.29.27"
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class PhotoInfo:
|
|||||||
@property
|
@property
|
||||||
def filename(self):
|
def filename(self):
|
||||||
""" filename of the picture """
|
""" filename of the picture """
|
||||||
|
# sourcery off
|
||||||
if self.has_raw and self.raw_original:
|
if self.has_raw and self.raw_original:
|
||||||
# return name of the RAW file
|
# return name of the RAW file
|
||||||
# TODO: not yet implemented
|
# TODO: not yet implemented
|
||||||
@@ -89,8 +90,7 @@ class PhotoInfo:
|
|||||||
seconds = self._info["imageTimeZoneOffsetSeconds"] or 0
|
seconds = self._info["imageTimeZoneOffsetSeconds"] or 0
|
||||||
delta = timedelta(seconds=seconds)
|
delta = timedelta(seconds=seconds)
|
||||||
tz = timezone(delta)
|
tz = timezone(delta)
|
||||||
imagedate_utc = imagedate.astimezone(tz=tz)
|
return imagedate.astimezone(tz=tz)
|
||||||
return imagedate_utc
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def date_modified(self):
|
def date_modified(self):
|
||||||
@@ -101,8 +101,7 @@ class PhotoInfo:
|
|||||||
seconds = self._info["imageTimeZoneOffsetSeconds"] or 0
|
seconds = self._info["imageTimeZoneOffsetSeconds"] or 0
|
||||||
delta = timedelta(seconds=seconds)
|
delta = timedelta(seconds=seconds)
|
||||||
tz = timezone(delta)
|
tz = timezone(delta)
|
||||||
imagedate_utc = imagedate.astimezone(tz=tz)
|
return imagedate.astimezone(tz=tz)
|
||||||
return imagedate_utc
|
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -494,12 +493,11 @@ class PhotoInfo:
|
|||||||
self is not included in the returned list """
|
self is not included in the returned list """
|
||||||
if self._info["burst"]:
|
if self._info["burst"]:
|
||||||
burst_uuid = self._info["burstUUID"]
|
burst_uuid = self._info["burstUUID"]
|
||||||
burst_photos = [
|
return [
|
||||||
PhotoInfo(db=self._db, uuid=u, info=self._db._dbphotos[u])
|
PhotoInfo(db=self._db, uuid=u, info=self._db._dbphotos[u])
|
||||||
for u in self._db._dbphotos_burst[burst_uuid]
|
for u in self._db._dbphotos_burst[burst_uuid]
|
||||||
if u != self._uuid
|
if u != self._uuid
|
||||||
]
|
]
|
||||||
return burst_photos
|
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user