From 4a8fd5875906e9cb7fc3c283695e1be902f17cbe Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Mon, 20 Nov 2023 06:18:36 -0800 Subject: [PATCH] Ignore exportdb (#1287) * Added --ignore-exportdb, --no-exportdb * Added test for --no-exportdb --- osxphotos/cli/export.py | 80 +++++++++++++--- tests/generate_search_info_test_data.py | 6 +- tests/test_cli.py | 102 +++++++++++++++++---- tests/test_export_convert_to_jpeg.py | 2 +- tests/test_photokit.py | 21 +++-- tests/test_search_info_personal_library.py | 2 +- 6 files changed, 168 insertions(+), 45 deletions(-) diff --git a/osxphotos/cli/export.py b/osxphotos/cli/export.py index 132fc75f8..b4d61f5e6 100644 --- a/osxphotos/cli/export.py +++ b/osxphotos/cli/export.py @@ -49,7 +49,7 @@ from osxphotos.debug import is_debug from osxphotos.exiftool import get_exiftool_path from osxphotos.exifwriter import ExifWriter, exif_options_from_options -from osxphotos.export_db import ExportDB, ExportDBInMemory +from osxphotos.export_db import ExportDB, ExportDBInMemory, ExportDBTemp from osxphotos.exportoptions import ExportOptions, ExportResults from osxphotos.fileutil import FileUtilMacOS, FileUtilNoOp, FileUtilShUtil from osxphotos.path_utils import is_valid_filepath, sanitize_filename, sanitize_filepath @@ -757,6 +757,31 @@ f"Default is {DEFAULT_CHECKPOINT}; to prevent checkpointing of database, use `--checkpoint 0`", type=click.IntRange(min=0), ) +@click.option( + "--ignore-exportdb", + "-F", + is_flag=True, + help="If exporting to a directory that already contains an export database " + "and --update is not specified, do not prompt to continue but instead continue " + "the export. " + "Normally, if you export to a directory that already contains an export database " + "and do not specify --update, osxphotos will prompt you to continue. " + "This is because you may be inadvertently merging two export sets. " + "Use --ignore-exportdb to skip this prompt and continue the export. " + "The resulting export database will contain the combined state of both export sets. " + "Short option is '-F' (mnemonic: force export). " + "See also --update.", +) +@click.option( + "--no-exportdb", + is_flag=True, + help="Do not create an export database. " + "This exports all photos in the export set but does not save any state information " + "in the osxphotos export database. If you use --no-exportdb, you will not be able to use " + "--update on subsequent exports. " + "It is recommended that you do not use this option unless you are certain you understand " + "the implications. ", +) @click.option( "--tmpdir", metavar="DIR", @@ -915,6 +940,7 @@ def export( hidden, ignore_case, ignore_date_modified, + ignore_exportdb, ignore_signature, in_album, incloud, @@ -935,6 +961,7 @@ def export( name, no_comment, no_description, + no_exportdb, no_keyword, no_likes, no_location, @@ -1158,6 +1185,7 @@ def export( hidden = cfg.hidden ignore_case = cfg.ignore_case ignore_date_modified = cfg.ignore_date_modified + ignore_exportdb = cfg.ignore_exportdb ignore_signature = cfg.ignore_signature in_album = cfg.in_album incloud = cfg.incloud @@ -1177,6 +1205,7 @@ def export( name = cfg.name no_comment = cfg.no_comment no_description = cfg.no_description + no_exportdb = cfg.no_exportdb no_keyword = cfg.no_keyword no_likes = cfg.no_likes no_location = cfg.no_location @@ -1321,6 +1350,9 @@ def export( ("syndicated", "not_syndicated"), ("saved_to_library", "not_saved_to_library"), ("shared_moment", "not_shared_moment"), + ("ignore_exportdb", "update"), + ("no_exportdb", "update"), + ("no_exportdb", "force_update"), ] dependent_options = [ ("append", ("report")), @@ -1459,8 +1491,9 @@ def export( return # sanity check exportdb - if exportdb and exportdb != OSXPHOTOS_EXPORT_DB: - if pathlib.Path(pathlib.Path(dest) / OSXPHOTOS_EXPORT_DB).exists(): + expected_exportdb = pathlib.Path(pathlib.Path(dest) / OSXPHOTOS_EXPORT_DB) + if not no_exportdb and exportdb and exportdb != str(expected_exportdb): + if expected_exportdb.exists(): rich_click_echo( f"[warning]Warning: export database is '{exportdb}' but found '{OSXPHOTOS_EXPORT_DB}' in {dest}; using '{exportdb}'", err=True, @@ -1471,14 +1504,28 @@ def export( err=True, ) - # open export database - export_db_path = exportdb or os.path.join(dest, OSXPHOTOS_EXPORT_DB) + # sanity check export into previous export dest without --update or --exportdb + if ( + not update + and not force_update + and not exportdb + and not no_exportdb + and pathlib.Path(pathlib.Path(dest) / OSXPHOTOS_EXPORT_DB).exists() + ): + rich_click_echo( + f"[warning]Warning: found previous export database in '{dest}' but --update not specified; " + "osxphotos will not consider state of previous export which may result in duplicate files. " + "Please confirm that you want to continue without using --update", + err=True, + ) + if not ignore_exportdb and not click.confirm("Do you want to continue?"): + sys.exit(1) # check that export isn't in the parent or child of a previously exported library other_db_files = find_files_in_branch(dest, OSXPHOTOS_EXPORT_DB) if other_db_files: rich_click_echo( - "[warning]WARNING: found other export database files in this destination directory branch. " + "[warning]WARNING: found other export database files in this destination directory branch. " + "This likely means you are attempting to export files into a directory " + "that is either the parent or a child directory of a previous export. " + "Proceeding may cause your exported files to be overwritten.", @@ -1492,13 +1539,18 @@ def export( if not click.confirm("Do you want to continue?"): sys.exit(1) + # open export database + export_db_path = exportdb or os.path.join(dest, OSXPHOTOS_EXPORT_DB) + export_db_callback = None if dry_run: export_db = ExportDBInMemory(dbfile=export_db_path, export_dir=dest) fileutil = FileUtilNoOp else: export_db = ( - ExportDBInMemory(dbfile=export_db_path, export_dir=dest) + ExportDBTemp() + if no_exportdb + else ExportDBInMemory(dbfile=export_db_path, export_dir=dest) if ramdb else ExportDB(dbfile=export_db_path, export_dir=dest) ) @@ -1527,16 +1579,18 @@ def sigint_handler(signal, frame): # on macOS, FileUtilMacOS will take advantage of copy-on-write for APFS volumes fileutil = FileUtilMacOS - if verbose: + if no_exportdb: + verbose("Using temporary export database, no state information will be saved.") + else: if export_db.was_created: verbose(f"Created export database [filepath]{export_db_path}") else: verbose(f"Using export database [filepath]{export_db_path}") - upgraded = export_db.was_upgraded - if upgraded: - verbose( - f"Upgraded export database [filepath]{export_db_path}[/] from version [num]{upgraded[0]}[/] to [num]{upgraded[1]}[/]" - ) + upgraded = export_db.was_upgraded + if upgraded: + verbose( + f"Upgraded export database [filepath]{export_db_path}[/] from version [num]{upgraded[0]}[/] to [num]{upgraded[1]}[/]" + ) # save config to export_db export_db.set_config(cfg.write_to_str()) diff --git a/tests/generate_search_info_test_data.py b/tests/generate_search_info_test_data.py index 34c99e72b..e8d5ffd07 100644 --- a/tests/generate_search_info_test_data.py +++ b/tests/generate_search_info_test_data.py @@ -10,9 +10,9 @@ import osxphotos UUID = [ - "DC09F4D8-6173-452D-AC15-725C8D7C185E", - "AFECD4AB-937C-46AF-A79B-9C9A38AA42B1", - "A1C36260-92CD-47E2-927A-35DAF16D7882", + "14B8DE1D-4113-4948-BC11-C7046656C58C", # IMG_4179.HEIC + "F21DFA19-E3E8-4610-8401-0447345F3074", # IMG_1929.JPG, + "7D852FC8-EA03-49C9-96F7-B049CE44A7EA", # IMG_6162.JPG ] data = { diff --git a/tests/test_cli.py b/tests/test_cli.py index a3924400a..635c06dc0 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -9,7 +9,6 @@ import pathlib import re import shutil -import signal import sqlite3 import subprocess import tempfile @@ -69,11 +68,11 @@ def _normalize_fs_paths(paths): LOCAL_PHOTOSDB = os.path.expanduser("~/Pictures/Photos Library.photoslibrary") UUID_SKIP_LIVE_PHOTOKIT = { - "54A01B04-16D7-4FDE-8860-19F2A641E433": ["IMG_3203_edited.jpeg"], - "1F3DF341-B822-4531-999E-724D642FD8E7": ["IMG_4179.jpeg"], + "D3FA21AA-62B0-41BA-A45E-B9E09369908B": ["IMG_3203_edited.jpeg"], + "14B8DE1D-4113-4948-BC11-C7046656C58C": ["IMG_4179.jpeg"], } -UUID_DOWNLOAD_MISSING = "C6C712C5-9316-408D-A3C3-125661422DA9" # IMG_8844.JPG +UUID_DOWNLOAD_MISSING = "C07BB1E1-2F61-4263-AB8E-943FD47CF013" # IMG_8844.JPG UUID_FILE = "tests/uuid_from_file.txt" SKIP_UUID_FILE = "tests/skip_uuid_from_file.txt" @@ -1096,7 +1095,7 @@ def _normalize_fs_paths(paths): ] EXPORT_EXIF_DATA = [("EXIF:Make", "FUJIFILM", ["Tulips.jpg", "Tulips_edited.jpeg"])] -UUID_LIVE_EDITED = "136A78FA-1B90-46CC-88A7-CCA3331F0353" # IMG_4813.HEIC +UUID_LIVE_EDITED = "029A1751-8A59-48FE-B636-E73E760ECDA6" # IMG_4813.HEIC CLI_EXPORT_LIVE_EDITED = _normalize_fs_paths( [ "IMG_4813.HEIC", @@ -1653,7 +1652,7 @@ def test_export(): # pylint: disable=not-context-manager with runner.isolated_filesystem(): result = runner.invoke( - export, ["--library", os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V"] + export, [".", "--library", os.path.join(cwd, CLI_PHOTOS_DB), "-V"] ) assert result.exit_code == 0 files = glob.glob("*") @@ -1668,7 +1667,7 @@ def test_export_alt_copy(): with runner.isolated_filesystem(): result = runner.invoke( export, - ["--library", os.path.join(cwd, CLI_PHOTOS_DB), ".", "--alt-copy", "-V"], + [".", "--library", os.path.join(cwd, CLI_PHOTOS_DB), "--alt-copy", "-V"], ) assert result.exit_code == 0 files = glob.glob("*") @@ -1691,13 +1690,30 @@ def test_export_alt_db(): alt_db = os.path.join(database_temp, "Photos.sqlite") result = runner.invoke( export, - ["--library", library_root, "--alt-db", alt_db, ".", "-V"], + [".", "--library", library_root, "--alt-db", alt_db, "-V"], ) assert result.exit_code == 0 files = glob.glob("*") assert sorted(files) == sorted(CLI_EXPORT_FILENAMES + ["database"]) +def test_export_no_exportdb(): + """test basic export with --no-exportdb""" + runner = CliRunner() + cwd = os.getcwd() + # pylint: disable=not-context-manager + with runner.isolated_filesystem(): + result = runner.invoke( + export, + [".", "--library", os.path.join(cwd, CLI_PHOTOS_DB), "-V", "--no-exportdb"], + ) + assert result.exit_code == 0 + files = glob.glob("*") + assert sorted(files) == sorted(CLI_EXPORT_FILENAMES) + assert not os.path.exists(OSXPHOTOS_EXPORT_DB) + assert "Created export database" not in result.output + + def test_export_tmpdir(): """test basic export with --tmpdir""" runner = CliRunner() @@ -1708,9 +1724,9 @@ def test_export_tmpdir(): result = runner.invoke( export, [ + ".", "--library", os.path.join(cwd, CLI_PHOTOS_DB), - ".", "-V", "--tmpdir", tmpdir.name, @@ -1957,6 +1973,7 @@ def test_export_preview_file_exists(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--preview", "--uuid", CLI_EXPORT_UUID_MISSING, @@ -2054,6 +2071,7 @@ def test_export_preview_overwrite(): "--uuid", CLI_EXPORT_UUID, "--overwrite", + "-F", ], ) assert result.exit_code == 0 @@ -2569,6 +2587,7 @@ def test_export_exiftool_quicktime(): "--exiftool", "--uuid", f"{uuid}", + "-F", ], ) assert result.exit_code == 0 @@ -2671,6 +2690,7 @@ def test_export_exiftool_option(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--exiftool", "--exiftool-option", "-m", @@ -2696,6 +2716,7 @@ def test_export_exiftool_merge(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--exiftool", "--uuid", f"{uuid}", @@ -2731,6 +2752,7 @@ def test_export_exiftool_merge_sidecar(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--sidecar", "json", "--uuid", @@ -2777,6 +2799,7 @@ def test_export_exiftool_merge_sidecar_xmp(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--sidecar", "xmp", "--uuid", @@ -2806,6 +2829,7 @@ def test_export_exiftool_favorite_rating(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--exiftool", "--uuid", UUID_FAVORITE, @@ -5411,8 +5435,9 @@ def test_export_live_edited(): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", "--uuid", UUID_LIVE_EDITED, @@ -5777,6 +5802,7 @@ def test_export_then_hardlink(): ".", "--export-as-hardlink", "--overwrite", + "-F", ], ) assert result.exit_code == 0 @@ -6572,6 +6598,7 @@ def test_export_report(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[0]["uuid"], "--report", @@ -6595,6 +6622,7 @@ def test_export_report(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[1]["uuid"], "--report", @@ -6616,6 +6644,7 @@ def test_export_report(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[0]["uuid"], "--report", @@ -6649,6 +6678,7 @@ def test_export_report_json(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[0]["uuid"], "--report", @@ -6671,6 +6701,7 @@ def test_export_report_json(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[1]["uuid"], "--report", @@ -6691,6 +6722,7 @@ def test_export_report_json(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[0]["uuid"], "--report", @@ -6724,6 +6756,7 @@ def test_export_report_sqlite(report_file): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[0]["uuid"], "--report", @@ -6747,6 +6780,7 @@ def test_export_report_sqlite(report_file): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[1]["uuid"], "--report", @@ -6768,6 +6802,7 @@ def test_export_report_sqlite(report_file): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_REPORT[0]["uuid"], "--report", @@ -7772,6 +7807,7 @@ def test_config_command_line_precedence(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--load-config", "config.toml", ], @@ -7788,6 +7824,7 @@ def test_config_command_line_precedence(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--uuid", UUID_NOT_FROM_FILE, "--load-config", @@ -7857,6 +7894,7 @@ def test_export_exportdb(): os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", + "-F", "--exportdb", "export.db", ], @@ -7968,6 +8006,7 @@ def test_export_finder_tag_keywords_dry_run(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--finder-tag-keywords", "--uuid", f"{uuid}", @@ -7993,6 +8032,7 @@ def test_export_finder_tag_keywords(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--finder-tag-keywords", "--uuid", f"{uuid}", @@ -8071,6 +8111,7 @@ def test_export_finder_tag_template(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--finder-tag-template", "{person}", "--uuid", @@ -8152,6 +8193,7 @@ def test_export_finder_tag_template_multiple(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--finder-tag-template", "{keyword}", "--finder-tag-template", @@ -8187,6 +8229,7 @@ def test_export_finder_tag_template_keywords(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--finder-tag-keywords", "--finder-tag-template", "{person}", @@ -8221,6 +8264,7 @@ def test_export_finder_tag_template_multi_field(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--finder-tag-template", "{title};{descr}", "--uuid", @@ -8257,6 +8301,7 @@ def test_export_xattr_template_dry_run(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--xattr-template", "copyright", "osxphotos 2022", @@ -8294,6 +8339,7 @@ def test_export_xattr_template(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--xattr-template", "copyright", "osxphotos 2022", @@ -8372,6 +8418,7 @@ def test_export_jpeg_ext(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--uuid", uuid, ], @@ -8391,6 +8438,7 @@ def test_export_jpeg_ext(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--uuid", uuid, "--jpeg-ext", @@ -8418,6 +8466,7 @@ def test_export_jpeg_ext_not_jpeg(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--uuid", uuid, ], @@ -8437,6 +8486,7 @@ def test_export_jpeg_ext_not_jpeg(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--uuid", uuid, "--jpeg-ext", @@ -8581,8 +8631,9 @@ def test_export_burst_folder_album(local_photosdb): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", "--directory", "{folder_album}", @@ -8590,6 +8641,7 @@ def test_export_burst_folder_album(local_photosdb): photo.uuid, "--download-missing", "--use-photokit", + "-F", ], ) assert result.exit_code == 0 @@ -8618,9 +8670,11 @@ def test_export_burst_uuid(local_photosdb: osxphotos.PhotosDB): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", + "-F", "--uuid", photo.uuid, ], @@ -8633,9 +8687,11 @@ def test_export_burst_uuid(local_photosdb: osxphotos.PhotosDB): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", + "-F", "--uuid", photo.uuid, "--skip-bursts", @@ -8660,9 +8716,11 @@ def test_export_download_missing_file_exists(): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", + "-F", "--uuid", UUID_DOWNLOAD_MISSING, "--download-missing", @@ -8675,8 +8733,9 @@ def test_export_download_missing_file_exists(): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", "--uuid", UUID_DOWNLOAD_MISSING, @@ -8704,9 +8763,11 @@ def test_export_download_missing_preview(): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", + "-F", "--uuid", UUID_DOWNLOAD_MISSING, "--download-missing", @@ -8734,9 +8795,11 @@ def test_export_download_missing_preview_applescript(): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", + "-F", "--uuid", UUID_DOWNLOAD_MISSING, "--download-missing", @@ -8763,9 +8826,11 @@ def test_export_skip_live_photokit(): result = runner.invoke( export, [ - os.path.join(cwd, LOCAL_PHOTOSDB), ".", + "--library", + os.path.join(cwd, LOCAL_PHOTOSDB), "-V", + "-F", "--uuid", uuid, "--use-photos-export", @@ -9826,6 +9891,7 @@ def test_export_album_seq(): os.path.join(cwd, PHOTOS_DB_15_7), ".", "-V", + "-F", "--album", UUID_DICT_FOLDER_ALBUM_SEQ[uuid]["album"], "--directory", diff --git a/tests/test_export_convert_to_jpeg.py b/tests/test_export_convert_to_jpeg.py index 5a9187794..57cba3293 100644 --- a/tests/test_export_convert_to_jpeg.py +++ b/tests/test_export_convert_to_jpeg.py @@ -20,7 +20,7 @@ NAMES_DICT = {"raw": "DSC03584.jpeg", "heic": "IMG_3092.jpeg"} -UUID_LIVE_HEIC = "8EC216A2-0032-4934-BD3F-04C6259B3304" +UUID_LIVE_HEIC = "03EE6CE2-20E6-489D-A149-A2EC7D11C70A" # IMG_3259.heic NAMES_LIVE_HEIC = ["IMG_3259.jpeg", "IMG_3259.mov"] diff --git a/tests/test_photokit.py b/tests/test_photokit.py index 7f606319b..6b6fd19a8 100644 --- a/tests/test_photokit.py +++ b/tests/test_photokit.py @@ -29,41 +29,41 @@ UUID_DICT = { "plain_photo": { - "uuid": "C6C712C5-9316-408D-A3C3-125661422DA9", + "uuid": "C07BB1E1-2F61-4263-AB8E-943FD47CF013", "filename": "IMG_8844.JPG", }, - "hdr": {"uuid": "DD641004-4E37-4233-AF31-CAA0896490B2", "filename": "IMG_6162.JPG"}, + "hdr": {"uuid": "7D852FC8-EA03-49C9-96F7-B049CE44A7EA", "filename": "IMG_6162.JPG"}, "selfie": { - "uuid": "C925CFDC-FF2B-4E71-AC9D-C669B6453A8B", + "uuid": "F21DFA19-E3E8-4610-8401-0447345F3074", "filename": "IMG_1929.JPG", }, "video": { - "uuid": "F4430659-7B17-487E-8029-8C1ABEBE23DF", + "uuid": "A6F31CC4-213B-4F27-85FD-7DD81AF1ED09", "filename": "IMG_9411.TRIM.MOV", }, "hasadjustments": { - "uuid": "2F252D2C-C9DE-4BE1-8610-9F968C634D3D", + "uuid": "1D99D83D-F820-4D30-A831-7B45BDF294D3", "filename": "IMG_2860.JPG", "adjusted_size": 3012634, "unadjusted_size": 2580058, }, "slow_mo": { - "uuid": "160447F8-4EB0-4FAE-A26A-3D32EA698F75", + "uuid": "1B3FC526-9D27-48A1-A39D-47C5E1F0633C", "filename": "IMG_4055.MOV", }, "live_photo": { - "uuid": "8EC216A2-0032-4934-BD3F-04C6259B3304", + "uuid": "03EE6CE2-20E6-489D-A149-A2EC7D11C70A", "filename": "IMG_3259.HEIC", "filename_video": "IMG_3259.mov", }, "burst": { - "uuid": "CDE4E5D9-1428-41E6-8569-EC0C45FD8E5A", + "uuid": "A9BC0824-1200-4B6F-A071-779E1C555465", "filename": "IMG_8196.JPG", "burst_selected": 4, "burst_all": 5, }, "raw+jpeg": { - "uuid": "E3DD04AF-CB65-4D9B-BB79-FF4C955533DB", + "uuid": "3C973493-7109-40E9-BF8D-6476AE7C8001", "filename": "IMG_1994.JPG", "raw_filename": "IMG_1994.CR2", "unadjusted_size": 16128420, @@ -289,6 +289,7 @@ def test_export_video_current(): ### Slow-Mo VideoAsset +@pytest.mark.skip(reason="Slow-mo videos not working, #1286") def test_export_slow_mo_original(): """test VideoAsset.export for slow mo video""" test_dict = UUID_DICT["slow_mo"] @@ -304,6 +305,7 @@ def test_export_slow_mo_original(): assert export_path.stem == pathlib.Path(filename).stem +@pytest.mark.skip(reason="Slow-mo videos not working, #1286") def test_export_slow_mo_unadjusted(): """test VideoAsset.export for slow mo video""" test_dict = UUID_DICT["slow_mo"] @@ -319,6 +321,7 @@ def test_export_slow_mo_unadjusted(): assert export_path.stem == pathlib.Path(filename).stem +@pytest.mark.skip(reason="Slow-mo videos not working, #1286") def test_export_slow_mo_current(): """test VideoAsset.export for slow mo video""" test_dict = UUID_DICT["slow_mo"] diff --git a/tests/test_search_info_personal_library.py b/tests/test_search_info_personal_library.py index b8386dbb8..2f81c921e 100644 --- a/tests/test_search_info_personal_library.py +++ b/tests/test_search_info_personal_library.py @@ -17,7 +17,7 @@ PHOTOS_DB = "/Users/rhet/Pictures/Photos Library.photoslibrary" -with open("tests/search_info_test_data_10_15_7.json") as fp: +with open("tests/search_info_test_data_13.json") as fp: test_data = json.load(fp) UUID_SEARCH_INFO = test_data["UUID_SEARCH_INFO"]