From c7c5320587e31070b55cc8c7e74f30b0f9e61379 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Mon, 2 Nov 2020 05:53:11 -0800 Subject: [PATCH] Fix for issue #39 --- osxphotos/__main__.py | 11 +++++++---- osxphotos/_version.py | 2 +- osxphotos/photoinfo/photoinfo.py | 9 ++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/osxphotos/__main__.py b/osxphotos/__main__.py index 38244c4f..e15775fd 100644 --- a/osxphotos/__main__.py +++ b/osxphotos/__main__.py @@ -2317,10 +2317,13 @@ def export_photo( # if download_missing and the photo is missing or path doesn't exist, # try to download with Photos - use_photos_export = ( - download_missing and (photo.ismissing or not os.path.exists(photo.path)) - if not use_photos_export - else True + use_photos_export = use_photos_export or ( + download_missing + and ( + photo.ismissing + or not os.path.exists(photo.path) + or (export_edited and photo.path_edited is None) + ) ) # export the photo to each path in dest_paths diff --git a/osxphotos/_version.py b/osxphotos/_version.py index 3cce7bcf..1cb6f908 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,4 +1,4 @@ """ version info """ -__version__ = "0.36.5" +__version__ = "0.36.6" diff --git a/osxphotos/photoinfo/photoinfo.py b/osxphotos/photoinfo/photoinfo.py index de0829c2..3eacc4de 100644 --- a/osxphotos/photoinfo/photoinfo.py +++ b/osxphotos/photoinfo/photoinfo.py @@ -196,18 +196,15 @@ class PhotoInfo: """ absolute path on disk of the edited picture """ """ None if photo has not been edited """ - # TODO: break this code into a _path_edited_4 and _path_edited_5 - # version to simplify the big if/then; same for path_live_photo - try: return self._path_edited except AttributeError: if self._db._db_version <= _PHOTOS_4_VERSION: self._path_edited = self._path_edited_4() - return self._path_edited else: self._path_edited = self._path_edited_5() - return self._path_edited + + return self._path_edited def _path_edited_5(self): """ return path_edited for Photos >= 5 """ @@ -265,8 +262,6 @@ class PhotoInfo: # if self._info["isMissing"] == 1: # photopath = None # path would be meaningless until downloaded - # logging.debug(photopath) - return photopath def _path_edited_4(self):