Fix for exporting slow mo videos, issue #252

This commit is contained in:
Rhet Turnbull
2020-11-07 07:58:37 -08:00
parent 653b7e6600
commit 9d38885416
3 changed files with 16 additions and 1 deletions

View File

@@ -1269,6 +1269,9 @@ Returns True if photo is a panorama, otherwise False.
**Note**: The result of `PhotoInfo.panorama` will differ from the "Panoramas" Media Types smart album in that it will also identify panorama photos from older phones that Photos does not recognize as panoramas.
#### `slow_mo`
Returns True if photo is a slow motion video, otherwise False
#### `labels`
Returns image categorization labels associated with the photo as list of str.

View File

@@ -2277,6 +2277,8 @@ def export_photo(
global VERBOSE
VERBOSE = bool(verbose_)
# TODO: if --skip-original-if-edited, it's possible edited version is on disk but
# original is missing, in which case we should download the edited version
if not download_missing:
if photo.ismissing:
space = " " if not verbose_ else ""
@@ -2303,6 +2305,16 @@ def export_photo(
results_touched = []
export_original = not (skip_original_if_edited and photo.hasadjustments)
# slow_mo photos will always have hasadjustments=True even if not edited
if photo.path_edited is None:
if photo.slow_mo:
export_original = True
export_edited = False
elif not download_missing:
# requested edited version but it's missing, download original
export_original = True
export_edited = False
verbose(f"Edited file for {photo.original_filename} is missing, downloading original")
filenames = get_filenames_from_template(photo, filename_template, original_name)
for filename in filenames:

View File

@@ -1,4 +1,4 @@
""" version info """
__version__ = "0.36.8"
__version__ = "0.36.9"