Fixed bug related to issue #222
This commit is contained in:
@@ -683,9 +683,6 @@ def export2(
|
|||||||
f"Error exporting photo {self.uuid} to {dest} with use_photos_export"
|
f"Error exporting photo {self.uuid} to {dest} with use_photos_export"
|
||||||
)
|
)
|
||||||
|
|
||||||
# export metadata
|
|
||||||
info = export_db.get_info_for_uuid(self.uuid)
|
|
||||||
|
|
||||||
if sidecar_json:
|
if sidecar_json:
|
||||||
logging.debug("writing exiftool_json_sidecar")
|
logging.debug("writing exiftool_json_sidecar")
|
||||||
sidecar_filename = dest.parent / pathlib.Path(f"{dest.stem}{dest.suffix}.json")
|
sidecar_filename = dest.parent / pathlib.Path(f"{dest.stem}{dest.suffix}.json")
|
||||||
@@ -797,9 +794,9 @@ def export2(
|
|||||||
|
|
||||||
if touch_file:
|
if touch_file:
|
||||||
for exif_file in exif_files_updated:
|
for exif_file in exif_files_updated:
|
||||||
touched_files.append(exported_file)
|
touched_files.append(exif_file)
|
||||||
ts = int(self.date.timestamp())
|
ts = int(self.date.timestamp())
|
||||||
fileutil.utime(exported_file, (ts, ts))
|
fileutil.utime(exif_file, (ts, ts))
|
||||||
|
|
||||||
touched_files = list(set(touched_files))
|
touched_files = list(set(touched_files))
|
||||||
|
|
||||||
@@ -1121,7 +1118,7 @@ def _xmp_sidecar(
|
|||||||
use_persons_as_keywords=False,
|
use_persons_as_keywords=False,
|
||||||
keyword_template=None,
|
keyword_template=None,
|
||||||
description_template=None,
|
description_template=None,
|
||||||
extension=None
|
extension=None,
|
||||||
):
|
):
|
||||||
""" returns string for XMP sidecar
|
""" returns string for XMP sidecar
|
||||||
use_albums_as_keywords: treat album names as keywords
|
use_albums_as_keywords: treat album names as keywords
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ CLI_EXPORT_UUID_FROM_FILE_FILENAMES = [
|
|||||||
"wedding_edited.jpeg",
|
"wedding_edited.jpeg",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# determine if exiftool installed so exiftool tests can be skipped
|
# determine if exiftool installed so exiftool tests can be skipped
|
||||||
try:
|
try:
|
||||||
exiftool = get_exiftool_path()
|
exiftool = get_exiftool_path()
|
||||||
@@ -398,7 +399,6 @@ def setup_touch_tests():
|
|||||||
CLI_EXPORT_BY_DATE_TOUCH_UUID
|
CLI_EXPORT_BY_DATE_TOUCH_UUID
|
||||||
)
|
)
|
||||||
for photo in photos:
|
for photo in photos:
|
||||||
logging.warning(photo.path)
|
|
||||||
ts = int(photo.date.timestamp())
|
ts = int(photo.date.timestamp())
|
||||||
if photo.path is not None:
|
if photo.path is not None:
|
||||||
os.utime(photo.path, (ts, ts))
|
os.utime(photo.path, (ts, ts))
|
||||||
@@ -1826,6 +1826,7 @@ def test_export_filename_template_2():
|
|||||||
files = glob.glob("*.*")
|
files = glob.glob("*.*")
|
||||||
assert sorted(files) == sorted(CLI_EXPORTED_FILENAME_TEMPLATE_FILENAMES2)
|
assert sorted(files) == sorted(CLI_EXPORTED_FILENAME_TEMPLATE_FILENAMES2)
|
||||||
|
|
||||||
|
|
||||||
def test_export_filename_template_pathsep_in_name():
|
def test_export_filename_template_pathsep_in_name():
|
||||||
""" export photos using filename template with folder_album and "/" in album name """
|
""" export photos using filename template with folder_album and "/" in album name """
|
||||||
import locale
|
import locale
|
||||||
@@ -1850,7 +1851,7 @@ def test_export_filename_template_pathsep_in_name():
|
|||||||
"--directory",
|
"--directory",
|
||||||
"{folder_album,None}",
|
"{folder_album,None}",
|
||||||
"--uuid",
|
"--uuid",
|
||||||
CLI_EXPORT_UUID_STATUE
|
CLI_EXPORT_UUID_STATUE,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
@@ -1858,6 +1859,7 @@ def test_export_filename_template_pathsep_in_name():
|
|||||||
# assert fname in result.output
|
# assert fname in result.output
|
||||||
assert pathlib.Path(fname).is_file()
|
assert pathlib.Path(fname).is_file()
|
||||||
|
|
||||||
|
|
||||||
def test_export_filename_template_3():
|
def test_export_filename_template_3():
|
||||||
""" test --filename with invalid template """
|
""" test --filename with invalid template """
|
||||||
import glob
|
import glob
|
||||||
@@ -2951,7 +2953,7 @@ def test_export_touch_files_update():
|
|||||||
|
|
||||||
@pytest.mark.skipif(exiftool is None, reason="exiftool not installed")
|
@pytest.mark.skipif(exiftool is None, reason="exiftool not installed")
|
||||||
def test_export_touch_files_exiftool_update():
|
def test_export_touch_files_exiftool_update():
|
||||||
""" test complex export scenario with --update, --exiftol, and --touch-files """
|
""" test complex export scenario with --update, --exiftool, and --touch-files """
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import time
|
import time
|
||||||
|
|||||||
Reference in New Issue
Block a user