From 0dac64409b248507209a56e0c5e019ca30756b05 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 5 Jan 2020 18:36:58 -0800 Subject: [PATCH] Fixed bug in CLI export_photo -- live photo not exported if verbose wasn't set --- osxphotos/__main__.py | 4 +++- osxphotos/_version.py | 2 +- osxphotos/photosdb.py | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/osxphotos/__main__.py b/osxphotos/__main__.py index 939e73cd..4e132e77 100644 --- a/osxphotos/__main__.py +++ b/osxphotos/__main__.py @@ -991,7 +991,9 @@ def export_photo( if verbose: click.echo(f"Exporting live photo video of {filename} as {live_name}") - _copy_file(src_live, str(dest_live)) + + _copy_file(src_live, str(dest_live)) + return photo_path diff --git a/osxphotos/_version.py b/osxphotos/_version.py index e997884b..b065a84b 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.21.1" +__version__ = "0.21.2" diff --git a/osxphotos/photosdb.py b/osxphotos/photosdb.py index a9363875..9662f184 100644 --- a/osxphotos/photosdb.py +++ b/osxphotos/photosdb.py @@ -1130,6 +1130,10 @@ class PhotosDB: # Get info on remote/local availability for photos in shared albums # Shared photos have a null fingerprint (and some other photos do too) + # TODO: There may be a bug here, perhaps ZDATASTORESUBTYPE should be 1 --> it's the longest ZDATALENGTH (is this the original) + # Also, doesn't seem to be entirely accurate for PNGs (screenshots mostly) + # for PNGs, JPEG render seems to be used unless edited or exported + # see for example ./resources/renders/F/F2FF9B89-FB6F-4853-942B-9F8BEE8DFFA1_1_201_a.jpeg c.execute( """ SELECT ZGENERICASSET.ZUUID, @@ -1139,6 +1143,8 @@ class PhotosDB: JOIN ZADDITIONALASSETATTRIBUTES ON ZADDITIONALASSETATTRIBUTES.ZASSET = ZGENERICASSET.Z_PK JOIN ZINTERNALRESOURCE ON ZINTERNALRESOURCE.ZASSET = ZADDITIONALASSETATTRIBUTES.ZASSET WHERE ZDATASTORESUBTYPE = 0 OR ZDATASTORESUBTYPE = 3 """ + # WHERE ZDATASTORESUBTYPE = 1 OR ZDATASTORESUBTYPE = 3 """ + # WHERE ZDATASTORESUBTYPE = 0 OR ZDATASTORESUBTYPE = 3 """ # WHERE ZINTERNALRESOURCE.ZFINGERPRINT IS NULL AND ZINTERNALRESOURCE.ZDATASTORESUBTYPE = 3 """ )