diff --git a/tests/check_uuid.py b/tests/check_uuid.py new file mode 100644 index 00000000..07f9f4d6 --- /dev/null +++ b/tests/check_uuid.py @@ -0,0 +1,39 @@ +""" Use with output file created by dump_photo_info.scpt to check ouput + of osxphotos vs what Photos reports """ + +import csv + +import osxphotos + +photosdb = osxphotos.PhotosDB() +photos = photosdb.photos(movies=True) +photos_uuid = {p.uuid: p for p in photos} +got_uuid = {} + +inputfile = "photoslib1.txt" + +# check that each uuid in the library is in photos +with open(inputfile) as csv_file: + csv_reader = csv.reader(csv_file, delimiter=",") + for row in csv_reader: + uuid, *_ = row[0].split("/") + fname = row[1] + if uuid in got_uuid: + print(f"WARNING: uuid already in got_dict: {uuid} {fname}") + got_uuid[uuid] = fname + + if uuid not in photos_uuid: + print(f"missing uuid not in photos_uuid: {uuid}, {fname}") + +# check for uuids in photos not in the library +shared = 0 +not_shared = 0 +for uuid in photos_uuid: + if uuid not in got_uuid: + if photos_uuid[uuid].shared: + shared += 1 + else: + not_shared += 1 + print(f"missing uuid not in library:\n{photos_uuid[uuid].json()}") + +print(f"shared: {shared}, not_shared: {not_shared}") diff --git a/tests/dump_photo_info.scpt b/tests/dump_photo_info.scpt new file mode 100644 index 00000000..94fed356 Binary files /dev/null and b/tests/dump_photo_info.scpt differ diff --git a/tests/export_photo_info.scpt b/tests/export_photo_info.scpt deleted file mode 100644 index 1a58fbe2..00000000 Binary files a/tests/export_photo_info.scpt and /dev/null differ