diff --git a/photos/__init__.py b/photos/__init__.py index 7bdb5bc..54f7604 100644 --- a/photos/__init__.py +++ b/photos/__init__.py @@ -180,11 +180,17 @@ def _try_photo(photo: str, mtype: str, dgeo: Optional[LatLon]) -> Optional[Photo lon = convert(meta[LON], meta[LON_REF]) geo = (lat, lon) if dt is None: + # TODO eh. perhaps ignore all of instagram videos? they are also too behind in past... try: - dt = dt_from_path(photo) # ok, last try.. + edt = dt_from_path(photo) # ok, last try.. except Exception as e: logger.error(f"Error while trying to extract date from name {photo}") logger.exception(e) + else: + if edt is not None and edt > datetime.now(): + logger.error('datetime for %s is too far in future: %s', photo, edt) + else: + dt = edt return Photo(photo, dt, geo)